Browse Source

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
David Cermak 6 năm trước cách đây
mục cha
commit
a0c8de077b
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      examples/protocols/mqtt/ssl/main/app_main.c

+ 3 - 0
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);