MQTT-C
mqtt_response_publish Struct Reference

A publish packet received from the broker. More...

#include <mqtt.h>

Data Fields

uint8_t dup_flag
 The DUP flag. DUP flag is 0 if its the first attempt to send this publish packet. A DUP flag of 1 means that this might be a re-delivery of the packet.
uint8_t qos_level
 The quality of service level.
uint8_t retain_flag
 The retain flag of this publish message.
uint16_t topic_name_size
 Size of the topic name (number of characters).
const void * topic_name
 The topic name.
uint16_t packet_id
 The publish message's packet ID.
const void * application_message
 The publish message's application message.
size_t application_message_size
 The size of the application message in bytes.

(Note that these are not member symbols.)

ssize_t mqtt_unpack_publish_response (struct mqtt_response *mqtt_response, const uint8_t *buf)
 Deserialize a publish response from buf.

Detailed Description

A publish packet received from the broker.

A publish packet is received from the broker when a client publishes to a topic that the {local client} is subscribed to.

See also
MQTT v3.1.1: PUBLISH - Publish Message.
Examples
bio_publisher.c, openssl_publisher.c, reconnect_subscriber.c, simple_publisher.c, and simple_subscriber.c.

Field Documentation

◆ qos_level

uint8_t mqtt_response_publish::qos_level

The quality of service level.

See also
MQTT v3.1.1: QoS Definitions

◆ topic_name

const void* mqtt_response_publish::topic_name

The topic name.

Note
topic_name is not null terminated. Therefore topic_name_size must be used to get the string length.
Examples
reconnect_subscriber.c, and simple_subscriber.c.

The documentation for this struct was generated from the following file: