Get the size and Remaining Length of an MQTT CONNECT packet.
This function must be called before MQTT_SerializeConnect in order to get the size of the MQTT CONNECT packet that is generated from MQTTConnectInfo_t and optional MQTTPublishInfo_t. The size of the MQTTFixedBuffer_t supplied to MQTT_SerializeConnect must be at least pPacketSize
. The provided pConnectInfo
and pWillInfo
are valid for serialization with MQTT_SerializeConnect only if this function returns MQTTSuccess. The remaining length returned in pRemainingLength
and the packet size returned in pPacketSize
are valid only if this function returns MQTTSuccess.
[in] | pConnectInfo | MQTT CONNECT packet parameters. |
[in] | pWillInfo | Last Will and Testament. Pass NULL if not used. |
[out] | pRemainingLength | The Remaining Length of the MQTT CONNECT packet. |
[out] | pPacketSize | The total size of the MQTT CONNECT packet. |
Example