sl_mqtt_server
|
SlMqttServerCbs_t Struct Reference
#include <sl_mqtt_server.h>
Public Attributes | |
_u16(* | sl_ExtLib_MqttConn )(_const char *clientId_str, _i32 clientId_len, _const char *username_str, _i32 username_len, _const char *password_str, _i32 password_len, void **usr) |
void(* | sl_ExtLib_MqttRecv )(_const char *topstr, _i32 toplen, _const void *payload, _i32 pay_len, bool dup, _u8 qos, bool retain) |
void(* | sl_ExtLib_MqttDisconn )(void *usr, bool due2err) |
void(* | sl_ExtLib_MqttEvent )(void *usr, _i32 evt, _const void *buf, _u32 len) |
Detailed Description
Callbacks Routines The routines are invoked by SL MQTT Server Implementation onto Server 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.
Member Data Documentation
_u16(* SlMqttServerCbs_t::sl_ExtLib_MqttConn)(_const char *clientId_str, _i32 clientId_len, _const char *username_str, _i32 username_len, _const char *password_str, _i32 password_len, void **usr) |
Connect Request: Callback routine to indicate to server application that a CONNECT request has been received by the server.
\param[in] clientId_str clientId field in the CONNECT message received. \param[in] clientId_len length of ClientId \param[in] username_str Username field in teh CONNECT message received. \param[in] username_len length of username \param[in] password_str Password field in the CONNECT message received. \param[in] password_len length of password \param[out] usr placeholder to provision app's handle to this connection. \return 0x0000 or 0x0100 for success; Otherwise 0x02, 0x04 or 0x05 refer to spec for connack codes
void(* SlMqttServerCbs_t::sl_ExtLib_MqttDisconn)(void *usr, bool due2err) |
DISCONNECT: Callback routine to indicate to the Server Application that a client has disconnected.
- Parameters:
-
[in] usr app's handle to this connection. [in] due2err set to 1, if connection has been closed, without server receiving a DISCONNECT messsage.
- Returns:
- none.
void(* SlMqttServerCbs_t::sl_ExtLib_MqttEvent)(void *usr, _i32 evt, _const void *buf, _u32 len) |
Indication of event either from the server library or implementation generated. TBD - Reserved for future use.
- Parameters:
-
[in] usr app's handle to this connection. [in] evt identifier to the reported event. Refer to SL MQTT Server Events - TBD [in] buf points to buffer [in] len length of buffer
- Returns:
- none.
void(* SlMqttServerCbs_t::sl_ExtLib_MqttRecv)(_const char *topstr, _i32 toplen, _const void *payload, _i32 pay_len, bool dup, _u8 qos, bool retain) |
Callback routine to receive a PUBLISH from a client. The server app must provide this routine for the instances where it receives PUBLISH messages from clients. The callback is invoked in the context of the internal SL MQTT server Receive Task.
- Parameters:
-
[in] topstr name of topic on which PUBLISH is received by the server. Not NULL terminated. [in] toplen length of the topic name [in] payload refers to payload published by the server. [in] pay_len length of the payload. [in] dup assert to indicate that it is a duplicate message sent by the client [in] qoS quality of service of the received published message. [in] retain asserted to indicate that a retained message has been received
- Returns:
- none.
The documentation for this struct was generated from the following file:
- D:/Project/SimpleLink/mqtt/doxygen/server/sl_mqtt_server.h
Generated on Thu Jan 15 2015 18:28:55 for sl_mqtt_server by 1.8.0