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.
This commit is contained in:
Piyush Shah 2020-03-18 16:22:51 +05:30
parent 0c41fc73b5
commit f66fbb75e2
1 changed files with 1 additions and 1 deletions

View File

@ -766,7 +766,7 @@ esp_err_t wifi_prov_mgr_event_handler(void *ctx, system_event_t *event)
/* 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 ESP_OK;
}