ADD: Get the response code from a failing connection.

This commit adds an event information "connect_return_code" that is written
when the client state is MQTT_STATE_INIT, and the connection fails.

This event info can then be written by the user app to find out the reason
of the fail connection.

Merges https://github.com/espressif/esp-mqtt/pull/100
This commit is contained in:
João Cabral
2019-03-01 18:20:53 +00:00
committed by David Cermak
parent 430676cadb
commit 67042a1315
3 changed files with 33 additions and 22 deletions

View File

@@ -57,15 +57,6 @@ enum mqtt_message_type {
MQTT_MSG_TYPE_DISCONNECT = 14
};
enum mqtt_connect_return_code {
CONNECTION_ACCEPTED = 0,
CONNECTION_REFUSE_PROTOCOL,
CONNECTION_REFUSE_ID_REJECTED,
CONNECTION_REFUSE_SERVER_UNAVAILABLE,
CONNECTION_REFUSE_BAD_USERNAME,
CONNECTION_REFUSE_NOT_AUTHORIZED
};
typedef struct mqtt_message {
uint8_t *data;
uint32_t length;