coreMQTT v2.1.1
MQTT 3.1.1 Client Library
MQTT_GetPingreqPacketSize

Get the size of an MQTT PINGREQ packet.

MQTTStatus_t MQTT_GetPingreqPacketSize( size_t * pPacketSize );
MQTTStatus_t MQTT_GetPingreqPacketSize(size_t *pPacketSize)
Get the size of an MQTT PINGREQ packet.
Definition: core_mqtt_serializer.c:2388
MQTTStatus_t
Return codes from MQTT functions.
Definition: core_mqtt_serializer.h:99
Parameters
[out]pPacketSizeThe size of the MQTT PINGREQ 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 ping request packet.
status = MQTT_GetPingreqPacketSize( &packetSize );
assert( status == MQTTSuccess );
assert( packetSize == 2 );
// The application should allocate or use a static #MQTTFixedBuffer_t of
// size >= 2 to serialize the ping request.
@ MQTTSuccess
Definition: core_mqtt_serializer.h:100