TI's MQTT Demo with freertos CM4F
SlMqttServerCbs_t Struct Reference
[SL MQTT Server APIs]
Callbacks Routines The routines are invoked by SL MQTT Server Implementation onto Server application. More...
#include <sl_mqtt_server.h>
Data Fields | |
| uint8_t(* | sl_ExtLib_MqttConn )(const char *clientId_str, int32_t clientId_len, const char *username_str, int32_t username_len, const char *password_str, int32_t password_len, void **usr) |
| Connect Request: Callback routine to indicate to server application that a CONNECT request has been received by the server. | |
| void(* | sl_ExtLib_MqttRecv )(const char *topstr, int32_t toplen, const void *payload, int32_t pay_len, bool dup, uint8_t qos, bool retain) |
| Callback routine to receive a PUBLISH from a client. | |
| void(* | sl_ExtLib_MqttDisconn )(void *usr, bool due2err) |
| DISCONNECT: Callback routine to indicate to the Server Application that a client has disconnected. | |
| void(* | sl_ExtLib_MqttEvent )(void *usr, int32_t evt, const void *buf, uint32_t len) |
| Indication of event either from the server library or implementation generated. | |
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.
Definition at line 144 of file sl_mqtt_server.h.
Field Documentation
| uint8_t(* sl_ExtLib_MqttConn)(const char *clientId_str, int32_t clientId_len, const char *username_str, int32_t username_len, const char *password_str, int32_t password_len, void **usr) |
Connect Request: Callback routine to indicate to server application that a CONNECT request has been received by the server.
- Parameters:
-
[in] clientId_str clientId field in the CONNECT message received. [in] clientId_len length of ClientId [in] username_str Username field in teh CONNECT message received. [in] username_len length of username [in] password_str Password field in the CONNECT message received. [in] password_len length of password [out] usr placeholder to provision app's handle to this connection.
- Returns:
- 0x0000 or 0x0100 for success; Otherwise 0x02, 0x04 or 0x05 refer to spec for connack codes
Definition at line 160 of file sl_mqtt_server.h.
| void(* 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.
Definition at line 195 of file sl_mqtt_server.h.
| void(* sl_ExtLib_MqttEvent)(void *usr, int32_t evt, const void *buf, uint32_t 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.
Definition at line 207 of file sl_mqtt_server.h.
| void(* sl_ExtLib_MqttRecv)(const char *topstr, int32_t toplen, const void *payload, int32_t pay_len, bool dup, uint8_t 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.
Definition at line 180 of file sl_mqtt_server.h.
Generated on Wed Jul 13 2022 09:55:39 by
1.7.2