MQTT Server: D:/my_data/GIT/network_apps/netapps/mqtt/server/server_pkts.h File Reference

MQTT Server Package

D:/my_data/GIT/network_apps/netapps/mqtt/server/server_pkts.h File Reference
#include "mqtt_common.h"

Go to the source code of this file.


struct  mqtt_server_msg_cbs
struct  mqtt_server_lib_cfg


#define MQ_CONN_UTF8_BUF(utf8)   ((utf8)? (utf8)->buffer : NULL)
#define MQ_CONN_UTF8_LEN(utf8)   ((utf8)? (utf8)->length : 0)
#define MQC_UTF8_CLIENTID(utf8_vec)   (utf8_vec[0])
#define MQC_UTF8_WILL_TOP(utf8_vec)   (utf8_vec[1])
#define MQC_UTF8_WILL_MSG(utf8_vec)   (utf8_vec[2])
#define MQC_UTF8_USERNAME(utf8_vec)   (utf8_vec[3])
#define MQC_UTF8_PASSWORD(utf8_vec)   (utf8_vec[4])
#define MQC_CLIENTID_BUF(utf8_vec)   MQ_CONN_UTF8_BUF(MQC_UTF8_CLIENTID(utf8_vec))
#define MQC_CLIENTID_LEN(utf8_vec)   MQ_CONN_UTF8_LEN(MQC_UTF8_CLIENTID(utf8_vec))
#define MQC_WILL_TOP_BUF(utf8_vec)   MQ_CONN_UTF8_BUF(MQC_UTF8_WILL_TOP(utf8_vec))
#define MQC_WILL_TOP_LEN(utf8_vec)   MQ_CONN_UTF8_LEN(MQC_UTF8_WILL_TOP(utf8_vec))
#define MQC_WILL_MSG_BUF(utf8_vec)   MQ_CONN_UTF8_BUF(MQC_UTF8_WILL_MSG(utf8_vec))
#define MQC_WILL_MSG_LEN(utf8_vec)   MQ_CONN_UTF8_LEN(MQC_UTF8_WILL_MSG(utf8_vec))
#define MQC_USERNAME_BUF(utf8_vec)   MQ_CONN_UTF8_BUF(MQC_UTF8_USERNAME(utf8_vec))
#define MQC_USERNAME_LEN(utf8_vec)   MQ_CONN_UTF8_LEN(MQC_UTF8_USERNAME(utf8_vec))
#define MQC_PASSWORD_BUF(utf8_vec)   MQ_CONN_UTF8_BUF(MQC_UTF8_PASSWORD(utf8_vec))
#define MQC_PASSWORD_LEN(utf8_vec)   MQ_CONN_UTF8_LEN(MQC_UTF8_PASSWORD(utf8_vec))
#define MQP_SERVER_RX_LEN   1024


i32 mqtt_vh_msg_send (void *ctx_cl, u8 msg_type, enum mqtt_qos qos, bool has_vh, u16 vh_data)
i32 mqtt_vh_msg_send_locked (void *ctx_cl, u8 msg_type, enum mqtt_qos qos, bool has_vh, u16 vh_data)
i32 mqtt_server_pub_dispatch (void *ctx_cl, struct mqtt_packet *mqp, bool dup)
i32 mqtt_server_pub_dispatch_locked (void *ctx_cl, struct mqtt_packet *mqp, bool dup)
i32 mqtt_server_run (u32 wait_secs)
i32 mqtt_server_register_net_svc (const struct device_net_services *net)
i32 mqtt_server_lib_init (const struct mqtt_server_lib_cfg *cfg, const struct mqtt_server_msg_cbs *cbs)

Detailed Description

The C library provisions the interface / API(s) for the MQTT Server Packet LIB.

This is a light-weight library that enables the services of the MQTT protcol for user's server application(s) to exchange the MQTT packets with one or more remote clients. The Server Packet LIB is a simple and easy-to-use implementation to support both un-packing of the messages received from the remote clients and formation of packets to be sent to the remote clients.

The library is targeted to conform to MQTT 3.1.1 specification.

The Server Packet LIB is a highly portable software and implies a very limited set of dependencies on a platform. Importantly, these limited dependencies are common features used in the embedded and the networking world, and can be easily adapted to the target platforms. The services of the library are multi-task safe. Platform specific atomicity constructs are used, through abstractions, by the library to maintain data coherency and synchronization. In addition, the library can be configured to support several in-flight messages.

The Server Packet LIB can support multiple and simultaneous MQTT connections from clients. However, the responsibility of managing the clients and topics, authentication and approval for connections and supporting any other needs that specific to the deployment remains with the user application.

The number of the network connections that the Server Packet LIB can support is configurable through the compile line option / flag -DCFG_SR_MQTT_CTXS . In addition, the maximum length of the RX buffer used by the server is also configurable through the compile line option / flag -DCFG_SR_MAX_MQP_RX_LEN .

Any future extensions & development must follow the following guidelines. A new API or an extension to the existing API a) must be rudimentary b) must not imply a rule or policy (including a state machine) b) must ensure simple design and implementation
Generated on Mon Nov 17 2014 12:12:08 for MQTT Server by  doxygen 1.7.4