From 0e07b85d2f17fcc8e4214a5f0476e028e72b8425 Mon Sep 17 00:00:00 2001 From: Anurag Kar Date: Sat, 13 Jul 2019 15:48:23 +0530 Subject: [PATCH] wifi_prov_mgr : Added missing esp_event_post() for WIFI_PROV_END events --- components/wifi_provisioning/src/manager.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/components/wifi_provisioning/src/manager.c b/components/wifi_provisioning/src/manager.c index 3d7a8355c..795988539 100644 --- a/components/wifi_provisioning/src/manager.c +++ b/components/wifi_provisioning/src/manager.c @@ -512,6 +512,10 @@ static void prov_stop_task(void *arg) if (app_cb) { app_cb(app_data, WIFI_PROV_END, NULL); } + if (esp_event_post(WIFI_PROV_EVENT, WIFI_PROV_END, NULL, 0, portMAX_DELAY) != ESP_OK) { + ESP_LOGE(TAG, "Failed to post event WIFI_PROV_END"); + } + vTaskDelete(NULL); } } @@ -1346,6 +1350,9 @@ void wifi_prov_mgr_deinit(void) if (app_cb) { app_cb(app_data, WIFI_PROV_END, NULL); } + if (esp_event_post(WIFI_PROV_EVENT, WIFI_PROV_END, NULL, 0, portMAX_DELAY) != ESP_OK) { + ESP_LOGE(TAG, "Failed to post event WIFI_PROV_END"); + } } ESP_LOGD(TAG, "execute_event_cb : %d", WIFI_PROV_DEINIT); @@ -1357,7 +1364,9 @@ void wifi_prov_mgr_deinit(void) if (app_cb) { app_cb(app_data, WIFI_PROV_DEINIT, NULL); } - esp_event_post(WIFI_PROV_EVENT, WIFI_PROV_DEINIT, NULL, 0, portMAX_DELAY); + if (esp_event_post(WIFI_PROV_EVENT, WIFI_PROV_DEINIT, NULL, 0, portMAX_DELAY) != ESP_OK) { + ESP_LOGE(TAG, "Failed to post event WIFI_PROV_DEINIT"); + } } esp_err_t wifi_prov_mgr_start_provisioning(wifi_prov_security_t security, const char *pop,