Add reason code/string to the disconnect packet

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major
    • wd04
    • Affects Version/s: MQTT-SN-1.2
    • Component/s: MQTT-SN
    • None
    • Hide

      Section should now read;

      5.4.21 DISCONNECT

      Length MsgType ReturnCode SessionExpiryInterval ReasonString
      (octet 0) (1) (2) (3:6) (7:n)

      The format of the DISCONNECT message is illustrated in Table 24:

      • Length and MsgType: see Section 5.2.
      • ReturnCode: (optional) Reason for disconnection. See section 5.3.10.
      • Session Expiry Interval: (optional) contains the value of the Session Expiry Interval timer; when the value of this field is greater than zero, it is deemed to be sent by a client that wants to transition to the “asleep” state, see Section 6.14 for further details.
      • ReasonString: (optional) A string representing a clear text description of disconnection.

      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.

      A DISCONNECT message with a SessionExpiryInterval field is sent by a client when it wants to transition to the “asleep” state. The receipt of this message is also acknowledged by the gateway by means of a DISCONNECT message.

      Show
      Section should now read; 5.4.21 DISCONNECT Length MsgType ReturnCode SessionExpiryInterval ReasonString (octet 0) (1) (2) (3:6) (7:n) The format of the DISCONNECT message is illustrated in Table 24: Length and MsgType: see Section 5.2. ReturnCode: (optional) Reason for disconnection. See section 5.3.10. Session Expiry Interval: (optional) contains the value of the Session Expiry Interval timer; when the value of this field is greater than zero, it is deemed to be sent by a client that wants to transition to the “asleep” state, see Section 6.14 for further details. ReasonString: (optional) A string representing a clear text description of disconnection. 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. A DISCONNECT message with a SessionExpiryInterval field is sent by a client when it wants to transition to the “asleep” state. The receipt of this message is also acknowledged by the gateway by means of a DISCONNECT message.

      As in MQTT 5.0, the disconnect packet should contain a reason code, and perhaps a reason string so that the receiver has an explanation for the termination of the session.

            Assignee:
            simon.johnson
            Reporter:
            ian.craggs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: