From 4b030420a1d1dd69f552fa04a3eecd50c1bcb974 Mon Sep 17 00:00:00 2001 From: Piyush Shah Date: Wed, 18 Mar 2020 16:22:51 +0530 Subject: [PATCH] wifi_provisioning: Catch the Wi-Fi events even after Connection errors It was observed that after sending credentials, if the first Wi-Fi conection attempt fails, the Wi-Fi provisioning managager ignores subsequent Wi-Fi events. So, even if the device eventually connects to the AP, the provisioning stays on indefinitely. Changing a check so that subsequent events are also captured and provisioning finishes successfully. --- components/wifi_provisioning/src/manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/wifi_provisioning/src/manager.c b/components/wifi_provisioning/src/manager.c index 94e141ebc..c36b3a8a0 100644 --- a/components/wifi_provisioning/src/manager.c +++ b/components/wifi_provisioning/src/manager.c @@ -826,7 +826,7 @@ static void wifi_prov_mgr_event_handler_internal( /* Only handle events when credential is received and * Wi-Fi STA is yet to complete trying the connection */ - if (prov_ctx->prov_state != WIFI_PROV_STATE_CRED_RECV) { + if (prov_ctx->prov_state < WIFI_PROV_STATE_CRED_RECV) { RELEASE_LOCK(prov_ctx_lock); return; }