From 7d8ff31c599f416408257860f910816b0620c9dd Mon Sep 17 00:00:00 2001 From: David Cermak Date: Fri, 23 Aug 2019 09:42:15 +0200 Subject: [PATCH 1/2] mqtt: referenced esp-mqtt master to fix disconnect crash issue and update docs generation for mqtt library Backport of 6fb085dbc9e6d8bc232e7b8f506217f680d50ed0 --- components/mqtt/esp-mqtt | 2 +- docs/Doxyfile | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/mqtt/esp-mqtt b/components/mqtt/esp-mqtt index 6f1fc3785a..e3b013e2db 160000 --- a/components/mqtt/esp-mqtt +++ b/components/mqtt/esp-mqtt @@ -1 +1 @@ -Subproject commit 6f1fc3785af8cc7765f78dd93f09aeb0109cd2b7 +Subproject commit e3b013e2db58124ea68cf7c8f44a8cba6e1572b7 diff --git a/docs/Doxyfile b/docs/Doxyfile index 18a477275c..bad5dfc234 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -226,7 +226,8 @@ PREDEFINED = \ configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS=1 \ configNUM_THREAD_LOCAL_STORAGE_POINTERS=1 \ configUSE_APPLICATION_TASK_TAG=1 \ - configTASKLIST_INCLUDE_COREID=1 + configTASKLIST_INCLUDE_COREID=1 \ + "ESP_EVENT_DECLARE_BASE(x)=extern esp_event_base_t x" ## Do not complain about not having dot ## From eecd2f56ee6d29f62b803fafc7221cd3c3b7f69f Mon Sep 17 00:00:00 2001 From: David Cermak Date: Wed, 9 Oct 2019 11:03:26 +0200 Subject: [PATCH 2/2] mqtt: updated to latest version to include latest fixes, support for global CA store, extended error structure to receive mqtt specific errors. updated idf ssl example to use this error struct backport of 640eac84fa37af91bf40b49f10a97b30e4b7b6f8 --- examples/protocols/mqtt/ssl/main/app_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/protocols/mqtt/ssl/main/app_main.c b/examples/protocols/mqtt/ssl/main/app_main.c index 86697a03cc..3ce00741c7 100644 --- a/examples/protocols/mqtt/ssl/main/app_main.c +++ b/examples/protocols/mqtt/ssl/main/app_main.c @@ -115,6 +115,9 @@ static esp_err_t mqtt_event_handler(esp_mqtt_event_handle_t event) break; case MQTT_EVENT_ERROR: ESP_LOGI(TAG, "MQTT_EVENT_ERROR"); + if (event->error_handle->error_type == MQTT_ERROR_TYPE_CONNECTION_REFUSED) { + ESP_LOGI(TAG, "Connection refused error: 0x%x", event->error_handle->connect_return_code); + } break; default: ESP_LOGI(TAG, "Other event id:%d", event->event_id);