Skip to content

Commit

Permalink
Release v1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
arobenko committed Jul 27, 2023
2 parents 796af13 + 08c6e5f commit 1165bc0
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ build_script:

test_script:
- echo ------------------------- Testing -------------------------
- ctest
- ctest -V

2 changes: 1 addition & 1 deletion client/include/cc_mqttsn_client/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extern "C" {
#define CC_MQTTSN_CLIENT_MINOR_VERSION 0U

/// @brief Patch level of the library
#define CC_MQTTSN_CLIENT_PATCH_VERSION 3U
#define CC_MQTTSN_CLIENT_PATCH_VERSION 4U

/// @brief Macro to create numeric version as single unsigned number
#define CC_MQTTSN_CLIENT_MAKE_VERSION(major_, minor_, patch_) \
Expand Down
2 changes: 1 addition & 1 deletion gateway/include/cc_mqttsn_gateway/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define CC_MQTTSN_GW_MINOR_VERSION 0U

/// @brief Patch level of the library
#define CC_MQTTSN_GW_PATCH_VERSION 3U
#define CC_MQTTSN_GW_PATCH_VERSION 4U

/// @brief Macro to create numeric version as single unsigned number
#define CC_MQTTSN_GW_MAKE_VERSION(major_, minor_, patch_) \
Expand Down
6 changes: 5 additions & 1 deletion gateway/src/lib/session_op/PubSend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ void PubSend::newSends()
}

if (st.m_pendingClientDisconnect) {
sendDisconnect();
if (!m_disconnectAlreadySent) {
sendDisconnect();
m_disconnectAlreadySent = true;
}
return;
}

Expand Down Expand Up @@ -249,6 +252,7 @@ void PubSend::doSend()

if (m_currPub->m_qos == QoS_AtMostOnceDelivery) {
m_currPub.reset();
checkSend();
return;
}

Expand Down
1 change: 1 addition & 0 deletions gateway/src/lib/session_op/PubSend.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class PubSend : public SessionOp
bool m_registered = false;
bool m_acked = false;
bool m_ping = false;
bool m_disconnectAlreadySent = false;
};

} // namespace session_op
Expand Down
17 changes: 17 additions & 0 deletions gateway/test/Session.th
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include <list>
#include <vector>
#include <memory>
#include <iomanip>
#include <sstream>

#include "comms/comms.h"
#include "cc_mqttsn_gateway/Session.h"
Expand Down Expand Up @@ -82,6 +84,16 @@ private:
bool m_retain = false;
};

static std::string toString(const DataBuf& buf)
{
std::stringstream stream;
for (auto ch : buf) {
stream << std::hex << std::setw(2) << std::setfill('0') << static_cast<unsigned>(ch) << ' ';
}

return stream.str();
}

static SessionPtr allocSession(
State& state,
TestMsgHandler& handler,
Expand Down Expand Up @@ -1317,6 +1329,11 @@ private:

static void verifyNoOtherEvent(State& state, TestMsgHandler& handler)
{
if (!state.m_sentToClient.empty()) {
for (auto& data : state.m_sentToClient) {
TS_TRACE("Unverified data sent to client: " + toString(data));
}
}
TS_ASSERT(state.m_sentToClient.empty());
TS_ASSERT(state.m_sentToBroker.empty());
TS_ASSERT(state.m_tickReq.empty());
Expand Down

0 comments on commit 1165bc0

Please sign in to comment.