mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-16 08:56:51 +01:00
First Commit of MQTT-SN Gateway
Add new SensorNetwork XBee Add a sensor network type in a start message. Update MQTTSNClient to avoid build warning. Update WiringPi's functions to my original ones. BugFix check msgId before adding waitdTopicId table. BugFix Process termination procedures Update print curent time in millseconds. update move currentDateTime() to linux directory. Bugfix: blink blue lightiIndicator. Bugfix: Register returns wrong id. change a status of the client to Disconnected. change client status procedure Update README BugFix: change Network Disconnect procedures. Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
||||
/**
|
||||
* Determines the length of the MQTT connect packet that would be produced using the supplied connect options.
|
||||
* @param options the options to be used to build the connect packet
|
||||
@@ -116,7 +117,7 @@ int MQTTSNSerialize_disconnectLength(int duration)
|
||||
int len = 0;
|
||||
|
||||
FUNC_ENTRY;
|
||||
len = (duration >= 0) ? 3 : 1;
|
||||
len = (duration > 0) ? 3 : 1;
|
||||
FUNC_EXIT_RC(len);
|
||||
return len;
|
||||
}
|
||||
@@ -144,7 +145,7 @@ int MQTTSNSerialize_disconnect(unsigned char* buf, int buflen, int duration)
|
||||
ptr += MQTTSNPacket_encode(ptr, len); /* write length */
|
||||
writeChar(&ptr, MQTTSN_DISCONNECT); /* write message type */
|
||||
|
||||
if (duration >= 0)
|
||||
if (duration > 0)
|
||||
writeInt(&ptr, duration);
|
||||
|
||||
rc = ptr - buf;
|
||||
|
||||
Reference in New Issue
Block a user