Extract the MQTT packet type and length from incoming packet.
This function must be called for every incoming packet to retrieve the MQTTPacketInfo_t.type and MQTTPacketInfo_t.remainingLength. A MQTTPacketInfo_t is not valid until this routine has been invoked.
[in] | readFunc | Transport layer read function pointer. |
[in] | pNetworkContext | The network context pointer provided by the application. |
[out] | pIncomingPacket | Pointer to MQTTPacketInfo_t structure. This is where type, remaining length and packet identifier are stored. |
pIncomingPacket
is invalid, MQTTRecvFailed on transport receive failure, MQTTBadResponse if an invalid packet is read, and MQTTNoDataAvailable if there is nothing to read.Example