Commit Graph

5 Commits

Author SHA1 Message Date
Flavia Caforio
470cb93049 mqtt_client: Manage disconnect packet
In the mqtt5 protocol the broker can disconnect the client with
a disconnect packet. This packet contains a reason value that can be
useful for certain applications in which it is important to know
the reason of disconnection.
While the client is connected is possible that a disconnect packet
is reaceived by the broker to force a disconnection. Before this
patch this approach causes a generic error on transport in case of
disconnection from the broker. If the packet is managed before getting
an error it is possible to save the reason code in the
disconnect_return_code variable in the error_handle, and dispatch
the disconnect event that can be managed by the application event
loop, that now can know the reason of disconnection from the broker.
Reset the variable in case of error.

Signed-off-by: Flavia Caforio <flavia.caforio@amarulasolutions.com>
2025-02-18 16:24:13 +01:00
Euripedes Rocha
90b4a4538e feat: Add enum definition with typo to keep backwards compatibility
Added initial enum definitions with deprecated attribute.
Should be removed with a new version that can introduce a breaking
change.
2023-08-17 14:58:49 +02:00
Wang Kai
dc775bb52e fixing typos in mqtt5_error_reason_code 2023-07-24 23:23:32 +08:00
Nebojsa Cvetkovic
1011e63cbe feature: Include subscribe_id in esp_mqtt5_event_property_t 2023-02-09 18:44:47 +00:00
yuanjm
fdf2aeb36f Seperate MQTT5 from MQTT 3.1.1 2022-06-14 09:37:46 +00:00