From 474c38a5f366bb97f9a28f7bc5647eb95440bdcc Mon Sep 17 00:00:00 2001 From: "kapil.gupta" Date: Wed, 21 Oct 2020 10:56:19 +0530 Subject: [PATCH] esp_wifi: Add WPS Reason code in all failures --- components/wpa_supplicant/src/esp_supplicant/esp_wps.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_wps.c b/components/wpa_supplicant/src/esp_supplicant/esp_wps.c index acccaf32bd..a61aba992d 100644 --- a/components/wpa_supplicant/src/esp_supplicant/esp_wps.c +++ b/components/wpa_supplicant/src/esp_supplicant/esp_wps.c @@ -971,7 +971,8 @@ int wps_finish(void) wifi_config_t *config = (wifi_config_t *)os_zalloc(sizeof(wifi_config_t)); 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; } @@ -1241,12 +1242,13 @@ int wps_sm_rx_eapol_internal(u8 *src_addr, u8 *buf, u32 len) } out: 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); wps_set_status(WPS_STATUS_DISABLE); esp_wifi_disarm_sta_connection_timer_internal(); 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; }