Get packet size and Remaining Length of an MQTT SUBSCRIBE packet.
This function must be called before MQTT_SerializeSubscribe in order to get the size of the MQTT SUBSCRIBE packet that is generated from the list of MQTTSubscribeInfo_t. The size of the MQTTFixedBuffer_t supplied to MQTT_SerializeSubscribe must be at least pPacketSize
. The provided pSubscriptionList
is valid for serialization with MQTT_SerializeSubscribe 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] | pSubscriptionList | List of MQTT subscription info. |
[in] | subscriptionCount | The number of elements in pSubscriptionList. |
[out] | pRemainingLength | The Remaining Length of the MQTT SUBSCRIBE packet. |
[out] | pPacketSize | The total size of the MQTT SUBSCRIBE packet. |
Example