coreMQTT  v1.1.2
MQTT 3.1.1 Client Library
MQTT_GetDisconnectPacketSize

Get the size of an MQTT DISCONNECT packet.

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.
MQTTStatus_t
MQTTStatus_t
Return codes from MQTT functions.
Definition: core_mqtt_serializer.h:97
MQTTSuccess
@ MQTTSuccess
Definition: core_mqtt_serializer.h:98
MQTT_GetDisconnectPacketSize
MQTTStatus_t MQTT_GetDisconnectPacketSize(size_t *pPacketSize)
Get the size of an MQTT DISCONNECT packet.
Definition: core_mqtt_serializer.c:2111