MQTT-C
mqtt_response Struct Reference

A struct used to deserialize/interpret an incoming packet from the broker. More...

#include <mqtt.h>

Data Fields

struct mqtt_fixed_header fixed_header
 The mqtt_fixed_header of the deserialized packet.
union { 
   struct mqtt_response_connack   connack 
   struct mqtt_response_publish   publish 
   struct mqtt_response_puback   puback 
   struct mqtt_response_pubrec   pubrec 
   struct mqtt_response_pubrel   pubrel 
   struct mqtt_response_pubcomp   pubcomp 
   struct mqtt_response_suback   suback 
   struct mqtt_response_unsuback   unsuback 
   struct mqtt_response_pingresp   pingresp 
} decoded
 A union of the possible responses from the broker.

(Note that these are not member symbols.)

ssize_t mqtt_unpack_response (struct mqtt_response *response, const uint8_t *buf, size_t bufsz)
 Deserialize a packet from the broker.

Detailed Description

A struct used to deserialize/interpret an incoming packet from the broker.

Field Documentation

◆ [union]

union { ... } mqtt_response::decoded

A union of the possible responses from the broker.

Note
The fixed_header contains the control type. This control type corresponds to the member of this union that should be accessed. For example if fixed_header#control_type == MQTT_CONTROL_PUBLISH then decoded#publish should be accessed.

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