mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user