sl_mqtt_server
|
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] cfg refers to configuration parameters [in] cbs callbacks 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] topic topic of the data to be published. It is NULL terminated. [in] data binary data to be published [in] len length of the data [in] qos QoS for the publish message [in] retain Retain bit in the PUBLISH message sent out [in] flags Reserved 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] topic disenrollment 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] topic enrollment 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
