esp_wifi: Add WPS Reason code in all failures
@@ -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;
}
