Types#

This section provides a reference to the MQTT API data types.

Modules#

sl_mqtt_client_last_will_message_t

sl_mqtt_client_message_t

sl_mqtt_broker_t

sl_mqtt_client_credentials_t

sl_mqtt_client_configuration_t

sl_mqtt_client_topic_subscription_info_t

sl_mqtt_client_t

Typedefs#

typedef void(*
sl_mqtt_client_event_handler_t)(void *client, sl_mqtt_client_event_t event, void *event_data, void *context)

Handler for MQTT client Events.

typedef void(*
sl_mqtt_client_message_received_t)(void *client, sl_mqtt_client_message_t *message_to_be_published, void *context)

Handler for MQTT client RX message.

Typedef Documentation#

sl_mqtt_client_event_handler_t#

sl_mqtt_client_event_handler_t )(void *client, sl_mqtt_client_event_t event, void *event_data, void *context)

Handler for MQTT client Events.

Parameters
N/Aclient

Client on which the event occurred.

N/Aevent

Event occurred of type sl_mqtt_client_event_t

N/Aevent_data

Event data for the data. This parameter would be non-null only for MQTT_CLIENT_MESSAGED_RECEIVED and MQTT_CLIENT_ERROR.

N/Acontext

Context provided by user at the time of API call. The caller must ensure that the lifecycle of the context is retained until the callback is invoked. The deallocation of context is also the responsibility of the caller.


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

sl_mqtt_client_message_received_t#

sl_mqtt_client_message_received_t )(void *client, sl_mqtt_client_message_t *message_to_be_published, void *context)

Handler for MQTT client RX message.

Parameters
N/Aclient

Client which has received message.

N/Amessage_to_be_published

Message received of type sl_mqtt_client_message_t

N/Acontext

Context provided by user at the time of Subscribe API call. The caller must ensure that the lifecycle of the context is retained until the callback is invoked. The deallocation of context is also the responsibility of the caller.

Note

  • Due to the constraints from the firmware, is_retained, qos_level, packet_identifer, duplicate_message of sl_mqtt_client_message_t are not populated and shall be ignored while processing the message.


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