Constants#
This section provides a reference to the MQTT API constants.
Enumerations#
MQTT Quality of Service (QoS) levels.
MQTT Client connection states.
MQTT Client Events.
MQTT Client error statuses.
MQTT Client disconnection reasons.
MQTT TLS and certificate options.
Enumeration Documentation#
sl_mqtt_qos_t#
sl_mqtt_qos_t
MQTT Quality of Service (QoS) levels.
This enumeration defines the Quality of Service (QoS) levels for MQTT messages. QoS levels determine the guarantee of delivery for a message.
Note
Quality of Service (QoS) level 2 is not currently supported.
Enumerator | |
---|---|
SL_MQTT_QOS_LEVEL_0 | At most once delivery. The message is delivered according to the best efforts of the operating environment. Message loss can occur. |
SL_MQTT_QOS_LEVEL_1 | At least once delivery. The message is assured to arrive but duplicates can occur. |
SL_MQTT_QOS_LEVEL_2 | Exactly once delivery. The message is assured to arrive exactly once. (Not currently supported). |
55
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.
This enumeration defines the various states of the MQTT client during its lifecycle. These states indicate the current status of the client's connection to the MQTT broker.
Enumerator | |
---|---|
SL_MQTT_CLIENT_DISCONNECTED | Initial state. The client is not connected to the MQTT broker. |
SL_MQTT_CLIENT_TA_INIT | The client has successfully initialized the NWP(Network Wireless Processor) for MQTT. |
SL_MQTT_CLIENT_CONNECTION_FAILED | The client attempted to connect to the MQTT broker but failed. |
SL_MQTT_CLIENT_CONNECTED | The client is successfully connected to the MQTT broker. |
SL_MQTT_CLIENT_TA_DISCONNECTED | The NWP(Network Wireless Processor) is disconnected from the broker, but NWP deinitialization has not yet been called. |
68
of file components/service/mqtt/inc/sl_mqtt_client_types.h
sl_mqtt_version_t#
sl_mqtt_version_t
MQTT Protocol versions.
This enumeration defines the supported versions of the MQTT protocol. The version determines the protocol features and behaviors used by the MQTT client.
Enumerator | |
---|---|
SL_MQTT_VERSION_3 | MQTT Version 3.0. |
SL_MQTT_VERSION_3_1 | MQTT Version 3.1. |
83
of file components/service/mqtt/inc/sl_mqtt_client_types.h
sl_mqtt_client_event_t#
sl_mqtt_client_event_t
MQTT Client Events.
This enumeration defines the various events that can occur in the lifecycle of an MQTT client. These events notifies the application about changes in the client's state, or the receipt of messages.
Enumerator | |
---|---|
SL_MQTT_CLIENT_CONNECTED_EVENT | Event indicating that the MQTT client has successfully connected to the broker. |
SL_MQTT_CLIENT_DISCONNECTED_EVENT | Event indicating that the MQTT client has disconnected from the broker. |
SL_MQTT_CLIENT_MESSAGE_PUBLISHED_EVENT | Event indicating that a message has been successfully published by the MQTT client. |
SL_MQTT_CLIENT_MESSAGED_RECEIVED_EVENT | Event indicating that a message has been received by the MQTT client. |
SL_MQTT_CLIENT_SUBSCRIBED_EVENT | Event indicating that the MQTT client has successfully subscribed to a topic. |
SL_MQTT_CLIENT_UNSUBSCRIBED_EVENT | Event indicating that the MQTT client has successfully unsubscribed from a topic. |
SL_MQTT_CLIENT_ERROR_EVENT | Event indicating that an error has occurred in the MQTT client. |
95
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 statuses.
This enumeration defines the various error statuses that can occur in the MQTT client. These statuses indicate the type of error that has occurred during the client's operations.
Enumerator | |
---|---|
SL_MQTT_CLIENT_CONNECT_FAILED | Error status indicating that the MQTT client failed to connect to the broker. |
SL_MQTT_CLIENT_PUBLISH_FAILED | Error status indicating that the MQTT client failed to publish a message. |
SL_MQTT_CLIENT_SUBSCRIBE_FAILED | Error status indicating that the MQTT client failed to subscribe to a topic. |
SL_MQTT_CLIENT_UNSUBSCRIBED_FAILED | Error status indicating that the MQTT client failed to unsubscribe from a topic. |
SL_MQTT_CLIENT_DISCONNECT_FAILED | Error status indicating that the MQTT client failed to disconnect from the broker. |
SL_MQTT_CLIENT_UNKNOWN_ERROR | Error status indicating that an unknown error occurred in the MQTT client. |
112
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 reasons.
This enumeration defines the various reasons for the disconnection of an MQTT client from the broker. These reasons help in identifying the cause of the disconnection.
Enumerator | |
---|---|
SL_MQTT_CLIENT_REMOTE_TERMINATE_DISCONNECTION | Disconnection due to remote termination by the broker. |
SL_MQTT_CLIENT_WLAN_DISCONNECTION | Disconnection due to WLAN (Wi-Fi) network issues. |
SL_MQTT_CLIENT_USER_INITIATED_DISCONNECTION | Disconnection initiated by the user. |
SL_MQTT_CLIENT_KEEP_ALIVE_RESPONSE_TIMEOUT_DISCONNECTION | Disconnection due to keep-alive response timeout. |
128
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.
This enumeration defines the various TLS (Transport Layer Security) and certificate options available for the MQTT client. These options include enabling TLS, selecting the TLS version, and choosing the certificate index.
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. |
147
of file components/service/mqtt/inc/sl_mqtt_client_types.h