mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
esp_wifi: Add WPS Reason code in all failures
This commit is contained in:
@ -971,7 +971,8 @@ int wps_finish(void)
|
|||||||
wifi_config_t *config = (wifi_config_t *)os_zalloc(sizeof(wifi_config_t));
|
wifi_config_t *config = (wifi_config_t *)os_zalloc(sizeof(wifi_config_t));
|
||||||
|
|
||||||
if (config == NULL) {
|
if (config == NULL) {
|
||||||
esp_event_send_internal(WIFI_EVENT, WIFI_EVENT_STA_WPS_ER_FAILED, 0, 0, portMAX_DELAY);
|
wifi_event_sta_wps_fail_reason_t reason_code = WPS_FAIL_REASON_NORMAL;
|
||||||
|
esp_event_send_internal(WIFI_EVENT, WIFI_EVENT_STA_WPS_ER_FAILED, &reason_code, sizeof(reason_code), portMAX_DELAY);
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1241,12 +1242,13 @@ int wps_sm_rx_eapol_internal(u8 *src_addr, u8 *buf, u32 len)
|
|||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
if (ret != 0 || res == WPS_FAILURE) {
|
if (ret != 0 || res == WPS_FAILURE) {
|
||||||
|
wifi_event_sta_wps_fail_reason_t reason_code = WPS_FAIL_REASON_NORMAL;
|
||||||
wpa_printf(MSG_DEBUG, "wpa rx eapol internal: fail ret=%d", ret);
|
wpa_printf(MSG_DEBUG, "wpa rx eapol internal: fail ret=%d", ret);
|
||||||
wps_set_status(WPS_STATUS_DISABLE);
|
wps_set_status(WPS_STATUS_DISABLE);
|
||||||
esp_wifi_disarm_sta_connection_timer_internal();
|
esp_wifi_disarm_sta_connection_timer_internal();
|
||||||
ets_timer_disarm(&sm->wps_timeout_timer);
|
ets_timer_disarm(&sm->wps_timeout_timer);
|
||||||
|
|
||||||
esp_event_send_internal(WIFI_EVENT, WIFI_EVENT_STA_WPS_ER_FAILED, 0, 0, portMAX_DELAY);
|
esp_event_send_internal(WIFI_EVENT, WIFI_EVENT_STA_WPS_ER_FAILED, &reason_code, sizeof(reason_code), portMAX_DELAY);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user