net: mqtt: Maintain count of PINGREQ awaiting response

Maintain a simple count of how many PINGREQ have been sent for the
current connection that have not had a corresponding PINGRESP.  Nothing
is done with this information internal to the MQTT driver, but it is
exposed to the application layer to monitor as desired.

Signed-off-by: Justin Brzozoski <justin.brzozoski@signal-fire.com>
This commit is contained in:
Justin Brzozoski 2019-12-12 13:33:36 -05:00 committed by Jukka Rissanen
commit 0116729114
3 changed files with 19 additions and 0 deletions

View file

@ -499,6 +499,9 @@ struct mqtt_client {
/** MQTT protocol version. */
u8_t protocol_version;
/** Unanswered PINGREQ count on this connection. */
s8_t unacked_ping;
/** Will retain flag, 1 if will message shall be retained persistently.
*/
u8_t will_retain : 1;