MQTT-C
Data Fields | Related Functions
mqtt_response_suback Struct Reference

The response to a subscription request. More...

#include <mqtt.h>

Data Fields

uint16_t packet_id
 The published messages packet ID.
 
const uint8_t * return_codes
 
size_t num_return_codes
 

Related Functions

(Note that these are not member functions.)

ssize_t mqtt_unpack_suback_response (struct mqtt_response *mqtt_response, const uint8_t *buf)
 Deserialize a SUBACK packet from buf. More...
 

Detailed Description

The response to a subscription request.

See also
MQTT v3.1.1: SUBACK - Subscription Acknowledgement.

Friends And Related Function Documentation

◆ mqtt_unpack_suback_response()

ssize_t mqtt_unpack_suback_response ( struct mqtt_response mqtt_response,
const uint8_t *  buf 
)
related

Deserialize a SUBACK packet from buf.

Precondition
mqtt_unpack_fixed_header must have returned a positive value and the mqtt_response must have a control type of MQTT_CONTROL_SUBACK.
Parameters
[out]mqtt_responsethe response that is initialized from the contents of buf.
[in]bufthe buffer with the incoming data.
Returns
The number of bytes that were consumed, or 0 if the buffer does not contain enough bytes to parse the packet, or a negative value if there was a protocol violation.

Field Documentation

◆ num_return_codes

size_t mqtt_response_suback::num_return_codes

The number of return codes.

◆ return_codes

const uint8_t* mqtt_response_suback::return_codes

Array of return codes corresponding to the requested subscribe topics.

See also
MQTTSubackReturnCodes

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