Update revision to use TI's mqtt and Freertos.

Dependencies:   mbed client server

Fork of cc3100_Test_mqtt_CM3 by David Fletcher

Embed: (wiki syntax)

« Back to documentation index

SlMqttClientCbs_t Struct Reference

SlMqttClientCbs_t Struct Reference
[SL MQTT Client API]

Callbacks Routines The routines are invoked by SL Implementation onto Client application. More...

#include <sl_mqtt_client.h>

Data Fields

void(* sl_ExtLib_MqttRecv )(void *app_hndl, const char *topstr, int32_t toplen, const void *payload, int32_t pay_len, bool dup, unsigned char qos, bool retain)
 Callback routine to receive a PUBLISH from the server.
void(* sl_ExtLib_MqttEvent )(void *app_hndl, int32_t evt, const void *buf, uint32_t len)
 Indication of event either from the server or implementation generated.
void(* sl_ExtLib_MqttDisconn )(void *app_hndl)
 Notifies the client app about the termination of MQTT connection.

Detailed Description

Callbacks Routines The routines are invoked by SL Implementation onto Client application.

Note:
The user applications implement the callbacks that are registered with the libraries. While using the MQTT library, invoking the core library APIs from a callback should be avoided and can lead to lockup scenarios. It is recommended to signal another task from the callback routines invoked from the library and invoke the core library API calls from that task.

Definition at line 157 of file sl_mqtt_client.h.


Field Documentation

void(* sl_ExtLib_MqttDisconn)(void *app_hndl)

Notifies the client app about the termination of MQTT connection.

After servicing this callback, the client-app can destroy associated context if it no longer required

Parameters:
[in]app_hndlapplication handle returned

Definition at line 204 of file sl_mqtt_client.h.

void(* sl_ExtLib_MqttEvent)(void *app_hndl, int32_t evt, const void *buf, uint32_t len)

Indication of event either from the server or implementation generated.

These events are notified as part of the processing carried out by the internal recv task of the SL implementation. The application must populate the callback to receive events about the progress made by the SL Mqtt layer.

This handler is used by the SL Mqtt Layer to report acknowledgements from the server, in case, the application has chosen not to block the service invokes till the arrival of the corresponding ACK.

Parameters:
[in]app_hndlapplication handle returned
[in]evtidentifier to the reported event. Refer to SL MQTT Client Events
[in]bufpoints to buffer
[in]lenlength of buffer
Note:

Definition at line 195 of file sl_mqtt_client.h.

void(* sl_ExtLib_MqttRecv)(void *app_hndl, const char *topstr, int32_t toplen, const void *payload, int32_t pay_len, bool dup, unsigned char qos, bool retain)

Callback routine to receive a PUBLISH from the server.

The client app must provide this routine for the instances where it has subscribed to certain set of topics from the server. The callback is invoked in the context of the internal SL Receive Task.

Parameters:
[in]app_hndlapplication handle returned
[in]topstrname of topic published by the server. Not NUL terminated.
[in]toplenlength of the topic name published by the server.
[in]payloadrefers to payload published by the server.
[in]pay_lenlength of the payload.
[in]dupassert to indicate that it is re-send by the server
[in]qoSquality of service of the published message
[in]retainasserted to indicate that a retained message has been published
Returns:
none.

Definition at line 174 of file sl_mqtt_client.h.