mirror of
https://github.com/espressif/esp-mqtt.git
synced 2026-10-14 03:37:38 +00:00
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:
@@ -199,6 +199,7 @@ typedef struct {
|
||||
bool use_secure_element; /*!< enable secure element for enabling SSL connection */
|
||||
void *ds_data; /*!< carrier of handle for digital signature parameters */
|
||||
int network_timeout_ms; /*!< Abort network operation if it is not completed after this value, in milliseconds (defaults to 10s) */
|
||||
bool disable_keepalive; /*!< Set disable_keepalive=true to turn off keep-alive mechanism, false by default (keepalive is active by default). Note: setting the config value `keepalive` to `0` doesn't disable keepalive feature, but uses a default keepalive period */
|
||||
} esp_mqtt_client_config_t;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user