mqttreconnect

Reconnect to a broker after a connection has been lost.

Attention: Available only with Twin Activate commercial edition.

Syntax

[status, messageinfo] = mqttreconnect(clientid)

Inputs

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

Outputs

Status
reconnection status flag. values are 0 and 1
Type: scalar
messageinfo
description of reconnection status flag
Type: string
status = 0:
Reconnect to client: successful
status = other than 0:
Reconnect to client: unsuccessful

Examples

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