Part of TI's mqtt

Dependents:   mqtt_V1 cc3100_Test_mqtt_CM3

Embed: (wiki syntax)

« Back to documentation index

server_pkts.h File Reference

server_pkts.h File Reference

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

Go to the source code of this file.

Data Structures

struct  mqtt_server_msg_cbs
  Working Principle for implementing the call-back services: Implementation of the call-back services should report in return value, only about errors found in the RX processing. More...

Functions

int32_t mqtt_vh_msg_send (void *ctx_cl, uint8_t msg_type, enum mqtt_qos qos, bool has_vh, uint16_t vh_data)
 Send a Variable Header only message to the client.
int32_t mqtt_vh_msg_send_locked (void *ctx_cl, uint8_t msg_type, enum mqtt_qos qos, bool has_vh, uint16_t vh_data)
 mqtt_vh_msg_send() with mutual exclusion (in multi-task application).
int32_t mqtt_server_pub_dispatch (void *ctx_cl, struct mqtt_packet *mqp, bool dup)
 Dispatch application constructed PUBLISH message to the client.
int32_t mqtt_server_pub_dispatch_locked (void *ctx_cl, struct mqtt_packet *mqp, bool dup)
 mqtt_server_pub_dispatch() with mutual exclusion (in multi-task application).
int32_t mqtt_server_run (uint32_t wait_secs)
 Run the server packet LIB for the specified wait time.
int32_t mqtt_server_register_net_svc (const struct device_net_services *net)
 Abstraction for the device specific network services Network services for communication with the clients.
int32_t mqtt_server_lib_init (const struct mqtt_server_lib_cfg *cfg, const struct mqtt_server_msg_cbs *cbs)
 Initialize the MQTT Server Packet library This routine initializes the packet and network constructs that are required to manage the multiple network connetions.

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 .

Note:
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

Definition in file server_pkts.h.