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)(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)(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#

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

Handler for MQTT client Events.

Parameters
[out]client

Client on which the event occurred.

[out]event

Event occurred.

[out]event_data

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

[out]context

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 126 of file components/service/mqtt/inc/sl_mqtt_client_types.h

sl_mqtt_client_message_received#

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

Handler for MQTT client RX message.

Parameters
[out]client

Client which has received message.

[out]message

Message received.

[out]context

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 144 of file components/service/mqtt/inc/sl_mqtt_client_types.h