Uploaded image for project: 'OASIS Message Queuing Telemetry Transport (MQTT) TC'
  1. OASIS Message Queuing Telemetry Transport (MQTT) TC
  2. MQTT-574

Add reason code/string to the disconnect packet

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Applied
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: MQTT-SN-1.2
    • Fix Version/s: wd04
    • Component/s: MQTT-SN
    • Labels:
      None
    • Proposal:
      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.

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                simon.johnson Simon Johnson [X] (Inactive)
                Reporter:
                ian.craggs Ian Craggs
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: