mqtt: Allow client to override keepalive

This change will allow an MQTT client to override the compile-time
keepalive if desired.  The change is structured such that the
compile-time default will still be setup by calling mqtt_client_init,
but can be changed by the application before calling mqtt_connect if
desired.

Signed-off-by: Justin Brzozoski <justin.brzozoski@signal-fire.com>
This commit is contained in:
Justin Brzozoski 2019-06-27 14:24:23 -04:00 committed by Anas Nashif
commit ffe25df82a
3 changed files with 10 additions and 4 deletions

View file

@ -476,6 +476,11 @@ struct mqtt_client {
/** Size of transmit buffer. */
u32_t tx_buf_size;
/** Keepalive interval for this client in seconds.
* Default is CONFIG_MQTT_KEEPALIVE.
*/
u16_t keepalive;
/** MQTT protocol version. */
u8_t protocol_version;