CONNACK signals that the connection with the server has been established.
It is common to wait for CONNACK before sending e.g. subscribe requests.
In some cases it is necessary, e.g. with Thingsboard (reference).
Sometimes a dialogue is required between client and broker at connection time, which may require calling mqtt_sync(). This can safely be done from the connected callback.
CONNACK signals that the connection with the server has been established.
It is common to wait for CONNACK before sending e.g. subscribe requests. In some cases it is necessary, e.g. with Thingsboard (reference).
Sometimes a dialogue is required between client and broker at connection time, which may require calling
mqtt_sync()
. This can safely be done from theconnected
callback.