Update revision to use TI's mqtt and Freertos.

Dependencies:   mbed client server

Fork of cc3100_Test_mqtt_CM3 by David Fletcher

Embed: (wiki syntax)

« Back to documentation index

mqtt_common.h File Reference

mqtt_common.h File Reference

This file incorporates constructs that are common to both client and server implementation. More...

Go to the source code of this file.

Data Structures

struct  utf8_string
 Description of UTF8 information as used by MQTT Library. More...
struct  utf8_strqos
 Construct to create Topic to SUBSCRIBE. More...

Enumerations

enum  mqtt_qos { MQTT_QOS0, MQTT_QOS1, MQTT_QOS2 }
 

MQTT Quality of Service.

More...

Functions

static uint32_t buf_wr_nbo_2B (uint8_t *buf, uint16_t val)
 Writing 2 bytes entity in network byte order.
static uint32_t buf_rd_nbo_2B (const uint8_t *buf, uint16_t *val)
 Reading 2 bytes entity in network byte order.
void mqp_free (struct mqtt_packet *mqp)
 Free a MQTT Packet Buffer Puts back the packet buffer in to the appropriate pool.
void mqp_reset (struct mqtt_packet *mqp)
 Resets the attributes of MQTT Packet Holder to its init state Not all fields are reset - entities such as offset, n_refs in addition to buffer information are not updated.
void mqp_init (struct mqtt_packet *mqp, uint8_t offset)
 Initializes attributes of the MQTT Packet Holder.
static void mqp_buffer_attach (struct mqtt_packet *mqp, uint8_t *buffer, uint32_t length, uint8_t offset)
 Initialize MQTT Packet Holder and attach the buffer.
int32_t mqp_buf_wr_utf8 (uint8_t *buf, const struct utf8_string *utf8)
 Write UTF8 information into the buffer.
int32_t mqp_buf_tail_wr_remlen (uint8_t *buf, uint32_t remlen)
 Write the MQTT construct 'Remaining Length' into trailing end of buffer.
int32_t mqp_buf_rd_remlen (uint8_t *buf, uint32_t *remlen)
 Read MQTT construct 'Remaining Length' from leading bytes of the buffer.
int32_t mqp_pub_append_topic (struct mqtt_packet *mqp, const struct utf8_string *topic, uint16_t msg_id)
 Include variable header Topic as part of PUB Message construction.
int32_t mqp_pub_append_data (struct mqtt_packet *mqp, const uint8_t *data_buf, uint32_t data_len)
 Include payload data for publishing The payload data is associated with a topic.
bool mqp_proc_msg_id_ack_rx (struct mqtt_packet *mqp_raw, bool has_payload)
 Construct a packet for Message ID enabled ACK received from network Process the raw ACK message information to update the packet holder.
bool mqp_proc_pub_rx (struct mqtt_packet *mqp_raw)
 Construct a packet for PUBLISH message received from the network Process the raw PUB message information to update the packet holder.
int32_t mqp_prep_fh (struct mqtt_packet *mqp, uint8_t flags)
 Prepare the Fixed-Header of the MQTT Packet (before being sent to network) Based on the contents of the mqtt packet and the combination of DUP, QoS and Retain flags as outlined the MQTT specification, the routine updates, among others, significant internal fields such as 'remaining length' and 'fixed header length' in the packet construct and embeds the fixed header, so created, in the packet buffer.

Detailed Description

This file incorporates constructs that are common to both client and server implementation.

The applications are not expected to utlize the routines made available in this module module.

Note:
the routines in this module do not check for availability and correctness of the input parameters
Warning:
The module is expected to under-go changes whilst incorporating support for the server. Therefore, it is suggested that applications do not rely on the services provided in this module.

Definition in file mqtt_common.h.