From 4d9c4fd7e13fd003b625cdf3b109cf43cb4d455e Mon Sep 17 00:00:00 2001 From: Kapil Gupta Date: Mon, 22 Aug 2022 20:25:02 +0530 Subject: [PATCH] wpa_supplicant: Fix WPS connection issue after WPS done esp_wifi_disconnect is needed to clear the wifi state and enable station to connect to new SSID. Add changes to call it after WPS is done. --- components/wpa_supplicant/esp_supplicant/src/esp_wps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c index 9f1b364c48..1622969d5e 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c @@ -2186,8 +2186,8 @@ int esp_wifi_wps_disable(void) wpa_printf(MSG_ERROR, "wps disable: failed to disable wps, ret=%d", ret); } - /* Only disconnect in case of WPS pending */ - if (wps_status == WPS_STATUS_PENDING) { + /* Only disconnect in case of WPS pending/done */ + if ((wps_status == WPS_STATUS_PENDING) || (wps_status == WPS_STATUS_SUCCESS)) { esp_wifi_disconnect(); } esp_wifi_set_wps_start_flag_internal(false);