sl_mqtt_server: SL MQTT Server APIs

MQTT Server

sl_mqtt_server
SL MQTT Server APIs

Modules

 SL MQTT Server Events

Classes

struct  SlMqttServerCbs_t
struct  SlMqttServerParams_t
struct  SlMqttServerCfg_t

Functions

_i32 sl_ExtLib_MqttServerInit (_const SlMqttServerCfg_t *cfg, _const SlMqttServerCbs_t *cbs)
_i32 sl_ExtLib_MqttTopicEnroll (_const char *topic)
_i32 sl_ExtLib_MqttTopicDisenroll (_const char *topic)
_i32 sl_ExtLib_MqttServerSend (_const char *topic, _const void *data, _i32 len, _u8 qos, bool retain, _u32 flags)

Function Documentation

_i32 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)
_i32 sl_ExtLib_MqttServerSend ( _const char *  topic,
_const void *  data,
_i32  len,
_u8  qos,
bool  retain,
_u32  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).
_i32 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).
_i32 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).
Generated on Thu Jan 15 2015 18:28:55 for sl_mqtt_server by   doxygen 1.8.0