Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] MQTT-SN DISCONNECT message's Duration is optional.

Hi All,

in MQTTSNPacket.c

 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)                <======
        writeInt(&ptr, duration);

if (duration >= 0)   should be   if (duration > 0) .
 what is the meaning of optional ?


Back to the top