Serialize an MQTT DISCONNECT packet into the given buffer.
MQTTStatus_t MQTT_SerializeDisconnect(const MQTTFixedBuffer_t *pFixedBuffer)
Serialize an MQTT DISCONNECT packet into the given buffer.
Definition: core_mqtt_serializer.c:2345
MQTTStatus_t
Return codes from MQTT functions.
Definition: core_mqtt_serializer.h:99
Buffer passed to MQTT library.
Definition: core_mqtt_serializer.h:135
The input MQTTFixedBuffer_t.size must be at least as large as the size returned by MQTT_GetDisconnectPacketSize.
- Parameters
-
[out] | pFixedBuffer | Buffer for packet serialization. |
- Returns
- MQTTNoMemory if pFixedBuffer is too small to hold the MQTT packet; MQTTBadParameter if invalid parameters are passed; MQTTSuccess otherwise.
Example
uint8_t buffer[ BUFFER_SIZE ];
fixedBuffer.
size = BUFFER_SIZE;
assert( packetSize <= BUFFER_SIZE );
{
}
MQTTStatus_t MQTT_GetDisconnectPacketSize(size_t *pPacketSize)
Get the size of an MQTT DISCONNECT packet.
Definition: core_mqtt_serializer.c:2325
@ 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