mqtt_config: Add config value to disable keepalive mechanism

Added a separate config value to allow disable the keepalive mechanism (and keep the existing API the same)
Internally though, the keepalive value (in connect_info) is in line with 3.1.2.10 Keep Alive from mqtt spec:
* keepalive=0: Keep alive mechanism disabled (server not to disconnect the client on its inactivity)
* period in seconds to send a Control packet if inactive

Closes https://github.com/espressif/esp-mqtt/issues/179
This commit is contained in:
David Cermak
2020-11-18 14:41:21 +01:00
parent e8be6c3aa7
commit 8562437c8a
3 changed files with 10 additions and 2 deletions

View File

@@ -83,7 +83,7 @@ typedef struct mqtt_connect_info {
char *password;
char *will_topic;
char *will_message;
int keepalive;
int keepalive; // keepalive=0 -> keepalive is disabled
int will_length;
int will_qos;
int will_retain;