sl_mqtt_server: SlMqttServerCbs_t Struct Reference

MQTT Server

SlMqttServerCbs_t Struct Reference

#include <sl_mqtt_server.h>

List of all members.

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]usrapp's handle to this connection.
[in]due2errset 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]usrapp's handle to this connection.
[in]evtidentifier to the reported event. Refer to SL MQTT Server Events - TBD
[in]bufpoints to buffer
[in]lenlength 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]topstrname of topic on which PUBLISH is received by the server. Not NULL terminated.
[in]toplenlength of the topic name
[in]payloadrefers to payload published by the server.
[in]pay_lenlength of the payload.
[in]dupassert to indicate that it is a duplicate message sent by the client
[in]qoSquality of service of the received published message.
[in]retainasserted to indicate that a retained message has been received
Returns:
none.

The documentation for this struct was generated from the following file:
Generated on Thu Jan 15 2015 18:28:55 for sl_mqtt_server by   doxygen 1.8.0