coreMQTT v2.1.1
MQTT 3.1.1 Client Library
MQTT_GetDisconnectPacketSize

Get the size of an MQTT DISCONNECT packet.

MQTTStatus_t MQTT_GetDisconnectPacketSize(size_t *pPacketSize)
Get the size of an MQTT DISCONNECT packet.
Definition: core_mqtt_serializer.c:2325
MQTTStatus_t
Return codes from MQTT functions.
Definition: core_mqtt_serializer.h:99
Parameters
[out]pPacketSizeThe size of the MQTT DISCONNECT packet.
Returns
MQTTSuccess, or MQTTBadParameter if pPacketSize is NULL.

Example

// Variables used in this example.
MQTTStatus_t status;
size_t packetSize = 0;
// Get the size requirement for the disconnect packet.
status = MQTT_GetDisconnectPacketSize( &packetSize );
assert( status == MQTTSuccess );
assert( packetSize == 2 );
// The application should allocate or use a static #MQTTFixedBuffer_t of
// size >= 2 to serialize the disconnect packet.
@ MQTTSuccess
Definition: core_mqtt_serializer.h:100