mqttdisconnect

Disconnect from the broker.

Attention: Available only with Twin Activate commercial edition.

Syntax

[status, messageinfo] = mqttdisconnect(clientid)

Inputs

clientid
client id, an output of mqttclient.
Type: string

Outputs

Status
disconnection status flag. values are 0,3,4.
Type: scalar
messageinfo
description of disconnection status flag.
Type: string
status = 0:
disconnect to client: successful.
status = 3:
disconnect to client: unsuccessful.
status = 4:
Disconnect to client: client isn’t connected to a broker.

Examples

Disconnect to a broker after a connection has been lost
cld = mqttclient('test.mosquitto.org','port',1883);
[status,msgeinfo] = mqttdisconnect(cld)
status = 0
msgeinfo = client disconnect: successful