mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/wps_disable_disconnect' into 'master'
WiFi: Do not disconnect in WPS disable API incase WPS is done/scanning Closes IDFGH-7807 See merge request espressif/esp-idf!19092
This commit is contained in:
commit
b8267a59eb
@ -1877,6 +1877,7 @@ int wifi_wps_disable_internal(void)
|
|||||||
int esp_wifi_wps_disable(void)
|
int esp_wifi_wps_disable(void)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
int wps_status;
|
||||||
|
|
||||||
if (ESP_OK != wps_check_wifi_mode()) {
|
if (ESP_OK != wps_check_wifi_mode()) {
|
||||||
return ESP_ERR_WIFI_MODE;
|
return ESP_ERR_WIFI_MODE;
|
||||||
@ -1890,7 +1891,8 @@ int esp_wifi_wps_disable(void)
|
|||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
wpa_printf(MSG_INFO, "wifi_wps_disable\n");
|
wps_status = wps_get_status();
|
||||||
|
wpa_printf(MSG_INFO, "wifi_wps_disable");
|
||||||
wps_set_type(WPS_TYPE_DISABLE); /* Notify WiFi task */
|
wps_set_type(WPS_TYPE_DISABLE); /* Notify WiFi task */
|
||||||
|
|
||||||
/* Call wps_delete_timer to delete all WPS timer, no timer will call wps_post()
|
/* Call wps_delete_timer to delete all WPS timer, no timer will call wps_post()
|
||||||
@ -1908,7 +1910,10 @@ int esp_wifi_wps_disable(void)
|
|||||||
wpa_printf(MSG_ERROR, "wps disable: failed to disable wps, ret=%d", ret);
|
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) {
|
||||||
esp_wifi_disconnect();
|
esp_wifi_disconnect();
|
||||||
|
}
|
||||||
esp_wifi_set_wps_start_flag_internal(false);
|
esp_wifi_set_wps_start_flag_internal(false);
|
||||||
wps_task_deinit();
|
wps_task_deinit();
|
||||||
s_wps_enabled = false;
|
s_wps_enabled = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user