ThingsBoard Client SDK 0.16.0
Client SDK to connect with ThingsBoard IoT Platform from IoT devices (Arduino, Espressif, etc.)
Loading...
Searching...
No Matches
Enumerations
MQTT_Connection_State.h File Reference
#include <stdint.h>
Include dependency graph for MQTT_Connection_State.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum class  MQTT_Connection_State : uint8_t {
  DISCONNECTED , CONNECTING , CONNECTED , DISCONNECTING ,
  ERROR
}
 Possible states the MQTT broker connection can be in. More...
 

Enumeration Type Documentation

◆ MQTT_Connection_State

enum class MQTT_Connection_State : uint8_t
strong

Possible states the MQTT broker connection can be in.

Note
Intermediate states connecting and disconnecting, are for the Espressif_MQTT_Client which is non blocking. Meaning calling disconnect will not immediately disconnect from the cloud but instead require a while. In comparsion Arduino_MQTT_Client is blocking, meaning we block until we disconnected or connected
Enumerator
DISCONNECTED 

Not yet connected or force disconnected from the MQTT broker. Loosing connection unexpectedly results in the ERROR state instead.

CONNECTING 

Received request to connect to the MQTT broker and connection is currently ongoing. Once successfull will be in CONNECTED state or alternatively in ERROR state if the connection failed.

CONNECTED 

Device has successfully connected to the MQTT broker. Should stay in this state until force disconnect is received or until error occurs in the connection to the MQTT broker.

DISCONNECTING 

Received request to force disconnect from the MQTT broker. Should always result in DISCONNECTED state once processed.

ERROR 

State for failure to connect to the MQTT broker or loosing connection unexpectedly, can be deciphered in more detail using MQTT_Connection_Error.