Skip to main content

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

Hi Tomoaki,

thanks for letting us see your progress so far, we appreciate the effort you are putting in.

Thanks!

Ian

On 04/24/2016 10:50 PM, Tomoaki Yamaguchi wrote:
Hi Ian,

I have uploaded the source code into my repository because it's buggy and  less comment.
https://github.com/ty4tw/paho.MQTTSN-embeded-C-Gateway.git

10 days vacation is coming in Japan so called Golden week.  (29th April - 8th May)
so, it's difficult to finish debugging by the end of April considering the current progress.
End of May is my next goal.

Tomoaki
 

2016-04-21 22:52 GMT+09:00 Ian Craggs <icraggs@xxxxxxxxxxxxxxxxxxxxxxx>:
Hi Tomoaki,

the MQTT-SN specification says (5.4.21):

"Duration: contains the value of the sleep timer; this field is optional and is included by a “sleeping” client that wants to go the “asleep” state, see Section 6.14 for further details."

"As with MQTT, the DISCONNECT message is sent by a client to indicate that it wants to close the connection. The gateway will acknowledge the receipt of that message by returning a DISCONNECT to the client. A server or gateway may also sends a DISCONNECT to a client, e.g. in case a gateway, due to an error, cannot map a received message to a client. Upon receiving such a DISCONNECT message, a client should try to setup the connection again by sending a CONNECT message to the gateway or server. In all these cases the DISCONNECT message does not contain the Duration field. 

A DISCONNECT message with a Duration field is sent by a client when it wants to go to the “asleep” state.  The receipt of this message is also acknowledged by the gateway by means of a DISCONNECT message (without a duration field)."


Does that answer your question?

The gateway does not have to support all functions to start with, or even to end with.  If you wanted to submit a work in progress for others to try out, test and review then that might be a good approach.

Thanks

Ian



On 04/21/2016 10:33 AM, Tomoaki Yamaguchi wrote:
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 ?

Tomoaki


_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev

-- 
Ian Craggs                          
icraggs@xxxxxxxxxx                 IBM United Kingdom
Paho Project Lead; Committer on Mosquitto


_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev



_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev

-- 
Ian Craggs                          
icraggs@xxxxxxxxxx                 IBM United Kingdom
Paho Project Lead; Committer on Mosquitto


Back to the top