Constants#

This section provides a reference to the MQTT API constants.

Enumerations#

enum
SL_MQTT_QOS_LEVEL_0
SL_MQTT_QOS_LEVEL_1
SL_MQTT_QOS_LEVEL_2
}

MQTT quality of service (QoS) levels.

enum
SL_MQTT_CLIENT_DISCONNECTED
SL_MQTT_CLIENT_TA_INIT
SL_MQTT_CLIENT_CONNECTION_FAILED
SL_MQTT_CLIENT_CONNECTED
SL_MQTT_CLIENT_TA_DISCONNECTED
}

MQTT Client connection states.

enum
SL_MQTT_VERSION_3
SL_MQTT_VERSION_3_1
}

MQTT Protocol version.

enum
SL_MQTT_CLIENT_CONNECTED_EVENT
SL_MQTT_CLIENT_DISCONNECTED_EVENT
SL_MQTT_CLIENT_MESSAGE_PUBLISHED_EVENT
SL_MQTT_CLIENT_MESSAGED_RECEIVED_EVENT
SL_MQTT_CLIENT_SUBSCRIBED_EVENT
SL_MQTT_CLIENT_UNSUBSCRIBED_EVENT
SL_MQTT_CLIENT_ERROR_EVENT
}

MQTT Client Events.

enum
SL_MQTT_CLIENT_CONNECT_FAILED
SL_MQTT_CLIENT_PUBLISH_FAILED
SL_MQTT_CLIENT_SUBSCRIBE_FAILED
SL_MQTT_CLIENT_UNSUBSCRIBED_FAILED
SL_MQTT_CLIENT_DISCONNECT_FAILED
SL_MQTT_CLIENT_UNKNKOWN_ERROR
}

MQTT Client error status.

enum
SL_MQTT_CLIENT_REMOTE_TERMINATE_DISCONNECTION
SL_MQTT_CLIENT_WLAN_DISCONNECTION
SL_MQTT_CLIENT_USER_INITIATED_DISCONNECTION
SL_MQTT_CLIENT_KEEP_ALIVE_RESPONSE_TIMEOUT_DISCONNECTION
}

MQTT Client disconnection reason.

enum
SL_MQTT_TLS_ENABLE = BIT(0)
SL_MQTT_TLS_TLSV_1_0 = BIT(1)
SL_MQTT_TLS_TLSV_1_1 = BIT(2)
SL_MQTT_TLS_TLSV_1_2 = BIT(3)
SL_MQTT_TLS_TLSV_1_3 = BIT(4)
SL_MQTT_TLS_CERT_INDEX_1 = BIT(5)
SL_MQTT_TLS_CERT_INDEX_2 = BIT(6)
}

MQTT TLS and certificate options.

Enumeration Documentation#

sl_mqtt_qos_t#

sl_mqtt_qos_t

MQTT quality of service (QoS) levels.

Note

  • Quality of service (QoS) level 2 not currently supported.

Enumerator
SL_MQTT_QOS_LEVEL_0

MQTT QoS level 0.

SL_MQTT_QOS_LEVEL_1

MQTT QoS level 1.

SL_MQTT_QOS_LEVEL_2

MQTT QoS level 2 (not currently supported)


Definition at line 49 of file components/service/mqtt/inc/sl_mqtt_client_types.h

sl_mqtt_client_connection_state_t#

sl_mqtt_client_connection_state_t

MQTT Client connection states.

Enumerator
SL_MQTT_CLIENT_DISCONNECTED

Initial state.

SL_MQTT_CLIENT_TA_INIT

Attains this state when TA MQTT is initialized successfully.

SL_MQTT_CLIENT_CONNECTION_FAILED

Attains this state when the connection to MQTT broker failed.

SL_MQTT_CLIENT_CONNECTED

Connection established with MQTT broker.

SL_MQTT_CLIENT_TA_DISCONNECTED

Definition at line 56 of file components/service/mqtt/inc/sl_mqtt_client_types.h

sl_mqtt_version_t#

sl_mqtt_version_t

MQTT Protocol version.

Enumerator
SL_MQTT_VERSION_3

MQTT Version 3.0.

SL_MQTT_VERSION_3_1

MQTT Version 3.1.


Definition at line 65 of file components/service/mqtt/inc/sl_mqtt_client_types.h

sl_mqtt_client_event_t#

sl_mqtt_client_event_t

MQTT Client Events.

Enumerator
SL_MQTT_CLIENT_CONNECTED_EVENT

MQTT client connected event.

SL_MQTT_CLIENT_DISCONNECTED_EVENT

MQTT client disconnected event.

SL_MQTT_CLIENT_MESSAGE_PUBLISHED_EVENT

MQTT client message published event.

SL_MQTT_CLIENT_MESSAGED_RECEIVED_EVENT

MQTT client message received event.

SL_MQTT_CLIENT_SUBSCRIBED_EVENT

MQTT client subscribed event.

SL_MQTT_CLIENT_UNSUBSCRIBED_EVENT

MQTT client unsubscribed event.

SL_MQTT_CLIENT_ERROR_EVENT

MQTT client error event.


Definition at line 71 of file components/service/mqtt/inc/sl_mqtt_client_types.h

sl_mqtt_client_error_status_t#

sl_mqtt_client_error_status_t

MQTT Client error status.

Enumerator
SL_MQTT_CLIENT_CONNECT_FAILED

MQTT client connect failed status.

SL_MQTT_CLIENT_PUBLISH_FAILED

MQTT client publish failed status.

SL_MQTT_CLIENT_SUBSCRIBE_FAILED

MQTT client subscribe failed status.

SL_MQTT_CLIENT_UNSUBSCRIBED_FAILED

MQTT client unsubscribe failed status.

SL_MQTT_CLIENT_DISCONNECT_FAILED

MQTT client disconnect failed status.

SL_MQTT_CLIENT_UNKNKOWN_ERROR

MQTT client unknown error status.


Definition at line 82 of file components/service/mqtt/inc/sl_mqtt_client_types.h

sl_mqtt_client_disconnection_reason_t#

sl_mqtt_client_disconnection_reason_t

MQTT Client disconnection reason.

Enumerator
SL_MQTT_CLIENT_REMOTE_TERMINATE_DISCONNECTION

Disconnection due to remote termination.

SL_MQTT_CLIENT_WLAN_DISCONNECTION

Disconnection due to WLAN disconnection.

SL_MQTT_CLIENT_USER_INITIATED_DISCONNECTION

User initiated disconnection.

SL_MQTT_CLIENT_KEEP_ALIVE_RESPONSE_TIMEOUT_DISCONNECTION

Disconnection due to keep alive timeout.


Definition at line 92 of file components/service/mqtt/inc/sl_mqtt_client_types.h

sl_mqtt_tls_flag_t#

sl_mqtt_tls_flag_t

MQTT TLS and certificate options.

Note

  • Only one TLS version (SL_MQTT_TLS_TLSV_X_X) can be set at a time.

  • Only one certificate index (SL_MQTT_TLS_CERT_INDEX_X) can be set at a time.

Enumerator
SL_MQTT_TLS_ENABLE

Enable TLS for MQTT.

SL_MQTT_TLS_TLSV_1_0

Enable TLS version 1.0 for MQTT.

SL_MQTT_TLS_TLSV_1_1

Enable TLS version 1.1 for MQTT.

SL_MQTT_TLS_TLSV_1_2

Enable TLS version 1.2 for MQTT.

SL_MQTT_TLS_TLSV_1_3

Enable TLS version 1.3 for MQTT.

SL_MQTT_TLS_CERT_INDEX_1

Use certificate index 1 for MQTT.

SL_MQTT_TLS_CERT_INDEX_2

Use certificate index 2 for MQTT.


Definition at line 105 of file components/service/mqtt/inc/sl_mqtt_client_types.h