fix(wps): Do not disconnect on WPS success in esp_wifi_wps_disable

When WPS succeeds, wps_finish() already handles disconnect, reconfigure,
and reconnect with the obtained credentials. The subsequent 4-way
handshake starts immediately. However, esp_wifi_wps_disable() (called
from the user's WPS success event handler) was also disconnecting when
status was WPS_STATUS_SUCCESS, killing the in-progress 4-way handshake.

Only disconnect in esp_wifi_wps_disable() when status is WPS_STATUS_PENDING
(i.e., WPS exchange was cancelled mid-way), matching the behavior on master.
This commit is contained in:
Sarvesh Bodakhe
2026-03-08 12:50:06 +05:30
parent 12445bd359
commit 016643417f
@@ -2044,8 +2044,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/done */
if ((wps_status == WPS_STATUS_PENDING) || (wps_status == WPS_STATUS_SUCCESS)) {
/* Only disconnect in case of WPS pending */
if (wps_status == WPS_STATUS_PENDING) {
esp_wifi_disconnect();
}
esp_wifi_set_wps_start_flag_internal(false);