Serialize an MQTT PUBACK, PUBREC, PUBREL, or PUBCOMP into the given buffer.
uint8_t packetType,
uint16_t packetId );
MQTTStatus_t MQTT_SerializeAck(const MQTTFixedBuffer_t *pFixedBuffer, uint8_t packetType, uint16_t packetId)
Serialize an MQTT PUBACK, PUBREC, PUBREL, or PUBCOMP into the given buffer.
Definition: core_mqtt_serializer.c:2270
MQTTStatus_t
Return codes from MQTT functions.
Definition: core_mqtt_serializer.h:99
Buffer passed to MQTT library.
Definition: core_mqtt_serializer.h:135
- Parameters
-
[out] | pFixedBuffer | Buffer for packet serialization. |
[in] | packetType | Byte of the corresponding packet fixed header per the MQTT spec. |
[in] | packetId | Packet ID of the publish. |
- Returns
- MQTTBadParameter, MQTTNoMemory, or MQTTSuccess.
Example
uint8_t buffer[ BUFFER_SIZE ];
uint16_t packetId;
uint8_t packetType;
fixedBuffer.
size = BUFFER_SIZE;
packetId = publishPacketId;
{
}
#define MQTT_PUBLISH_ACK_PACKET_SIZE
The size of MQTT PUBACK, PUBREC, PUBREL, and PUBCOMP packets, per MQTT spec.
Definition: core_mqtt_serializer.h:85
#define MQTT_PACKET_TYPE_PUBACK
PUBACK (bidirectional).
Definition: core_mqtt_serializer.h:68
@ MQTTSuccess
Definition: core_mqtt_serializer.h:100
size_t size
Size of buffer.
Definition: core_mqtt_serializer.h:137
uint8_t * pBuffer
Pointer to buffer.
Definition: core_mqtt_serializer.h:136