esp-mqtt library is unaware of underlying network connectivity states
and current auto reconnect mechanism is built around timed retry
attempts every MQTT_RECONNECT_TIMEOUT_MS.
As application code usually keeps track of network connectity state
export a new function that application can use to request a forced
reconnect attempt as soon as connected to the network.
When reconnect timer expires an additional waiting period of half the
timeout period is seen. Skip this extra waiting period when timeout
is detected and perform the connect attempt right away. This change
makes configured reconnect timeout value MQTT_RECONNECT_TIMEOUT_MS
accurate.
We have to enqueue first and then assign to outbound/pending variables,
otherwise the previous pending message is lost and the publish message
is present twice
- Fixed message type check: Previously, it checked for PUBREL, but the
enqueued packet is the PUBLISH packet, hence check for this type in
is_valid_mqtt_msg().
- Moved mqtt_enqueue after the preparation of the packet, so that the
correct message id gets stored (also relevant for QoS1).
* Adding disconnection if no pingresp
* Initializing wait_for_ping_resp to false
* Setting wait_for_ping_resp to false if aborting connection or when sending connect
* Remove unused code: the state here is always MQTT_STATE_CONNECTED.
Under the assumption that only the esp_mqtt_task can change the client state
(otherwise we are missing a lock around the state usage everywhere).
* Change the return type of esp_mqtt_client_ping from int to esp_err_t.
* Abort the MQTT connection if we can't send ping.
Try to handle the situation when the underlying connection changes and the
sockets have wrong status (see esp-idf/docs/api-guides/wifi.rst).
* add missing config for setting default port for SSL in Kconfig
* free the TCP only after closing the connection , not before
* set the config in the client before we access the schema in the client
* fix typo
* dispatch also Publish event