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

SL MQTT Server APIs

SL MQTT Server APIs

Data Structures

struct  SlMqttServerCbs_t
 Callbacks Routines The routines are invoked by SL MQTT Server Implementation onto Server application. More...
struct  SlMqttServerParams_t
 Secure Socket Parameters to open a secure connection. More...
struct  SlMqttServerCfg_t
 MQTT Server Lib structure which holds Initialization Data. More...

Modules

 SL MQTT Server Events

Functions

int32_t sl_ExtLib_MqttServerInit (const SlMqttServerCfg_t *cfg, const SlMqttServerCbs_t *cbs)
 Initialize the SL MQTT Server Implementation.
int32_t sl_ExtLib_MqttTopicEnroll (const char *topic)
 Enroll a topic to receive data App can enroll a topic of interest and the SL layer will forward to the app any data subsequently published for the enrolled topic to the server by any of the connected MQTT clients.
int32_t sl_ExtLib_MqttTopicDisenroll (const char *topic)
 DisEnroll a topic.
int32_t sl_ExtLib_MqttServerSend (const char *topic, const void *data, int32_t len, uint8_t qos, bool retain, uint32_t flags)
 PUBLISH a named message to a client.

Function Documentation

int32_t sl_ExtLib_MqttServerInit ( const SlMqttServerCfg_t *  cfg,
const SlMqttServerCbs_t *  cbs 
)

Initialize the SL MQTT Server Implementation.

A caller must initialize the MQTT Server implementation prior to using its services.

Parameters:
[in]cfgrefers to configuration parameters
[in]cbscallbacks into server application
Returns:
Success (0) or Failure (-1)

Definition at line 132 of file sl_mqtt_server.cpp.

int32_t sl_ExtLib_MqttServerSend ( const char *  topic,
const void *  data,
int32_t  len,
uint8_t  qos,
bool  retain,
uint32_t  flags 
)

PUBLISH a named message to a client.

In addition to the PUBLISH specific parameters, the caller can indicate whether the routine should block until the time, the message has been acknowleged by the client. This is applicable only for non-QoS0 messages.

In case, the app has chosen not to await for the ACK from the client, the SL MQTT Server implementation will notify the app about the received ACK through the callback routine.

Note:
Only QoS0 and QoS1 messages are supported.
Parameters:
[in]topictopic of the data to be published. It is NULL terminated.
[in]databinary data to be published
[in]lenlength of the data
[in]qosQoS for the publish message
[in]retainRetain bit in the PUBLISH message sent out
[in]flagsReserved for future use.
Returns:
Success(0) or Failure(-1).

Definition at line 96 of file sl_mqtt_server.cpp.

int32_t sl_ExtLib_MqttTopicDisenroll ( const char *  topic )

DisEnroll a topic.

App can cancel the previous enrollment of a topic and the SL layer will now stop forwarding data published for that topic to the server by the connected clients. This is analogous oe similar to an unsubsription by an MQTT client.

Parameters:
[in]topicdisenrollment topic. It is NULL terminated.
Returns:
Success(0) or Failure(-1).

Definition at line 116 of file sl_mqtt_server.cpp.

int32_t sl_ExtLib_MqttTopicEnroll ( const char *  topic )

Enroll a topic to receive data App can enroll a topic of interest and the SL layer will forward to the app any data subsequently published for the enrolled topic to the server by any of the connected MQTT clients.

This is analogous or similar to a subsription to a topic by an MQTT client.

Parameters:
[in]topicenrollment topic for data to be received. It is NULL terminated.
Returns:
Success(0) or Failure (-1).

Definition at line 106 of file sl_mqtt_server.cpp.