fix(esp_wifi): Add some bugfixes and cleanup in softAP

1. Fix wrong reason code in 'WIFI_EVENT_AP_STADISCONNECTED' event
2. cleanup in softAP for disconnecting connected station
3. Update examples to display reason while processing WIFI_EVENT_AP_STADISCONNECTED event
This commit is contained in:
Sarvesh Bodakhe
2024-12-11 15:36:54 +05:30
parent c571a595e8
commit 9584729322
8 changed files with 12 additions and 12 deletions

View File

@@ -109,7 +109,7 @@ ieee80211_output_do = 0x4000210c;
ieee80211_send_nulldata = 0x40002110;
//ieee80211_setup_robust_mgmtframe = 0x40002114;
//ieee80211_mgmt_output = 0x40002118;
ieee80211_send_deauth = 0x40002120;
ieee80211_send_deauth_no_bss= 0x40002120;
//ieee80211_tx_mgt_cb = 0x4000212c;
sta_rx_csa = 0x40002134;
sta_send_sa_query_req = 0x40002138;

View File

@@ -1016,7 +1016,7 @@ ieee80211_alloc_tx_buf = 0x40002108;
/* ieee80211_send_nulldata = 0x40002110; */
/* ieee80211_setup_robust_mgmtframe = 0x40002114; */
ieee80211_encap_null_data = 0x4000211c;
ieee80211_send_deauth = 0x40002120;
ieee80211_send_deauth_no_bss = 0x40002120;
ieee80211_alloc_deauth = 0x40002124;
ieee80211_send_proberesp = 0x40002128;
ieee80211_getcapinfo = 0x40002130;

View File

@@ -246,7 +246,7 @@ static void wifi_event_handler(void* arg, esp_event_base_t event_base,
}
case WIFI_EVENT_AP_STADISCONNECTED: {
wifi_event_ap_stadisconnected_t* event = (wifi_event_ap_stadisconnected_t*) event_data;
BLUFI_INFO("station "MACSTR" leave, AID=%d", MAC2STR(event->mac), event->aid);
BLUFI_INFO("station "MACSTR" leave, AID=%d, reason=%d", MAC2STR(event->mac), event->aid, event->reason);
break;
}

View File

@@ -39,8 +39,8 @@ static void wifi_event_handler(void *arg, esp_event_base_t event_base,
MAC2STR(event->mac), event->aid);
} else if (event_id == WIFI_EVENT_AP_STADISCONNECTED) {
wifi_event_ap_stadisconnected_t *event = (wifi_event_ap_stadisconnected_t *)event_data;
ESP_LOGI(TAG, "station " MACSTR " leave, AID=%d",
MAC2STR(event->mac), event->aid);
ESP_LOGI(TAG, "station " MACSTR " leave, AID=%d, reason=%d",
MAC2STR(event->mac), event->aid, event->reason);
}
}

View File

@@ -39,8 +39,8 @@ static void wifi_event_handler(void* arg, esp_event_base_t event_base,
MAC2STR(event->mac), event->aid);
} else if (event_id == WIFI_EVENT_AP_STADISCONNECTED) {
wifi_event_ap_stadisconnected_t* event = (wifi_event_ap_stadisconnected_t*) event_data;
ESP_LOGI(TAG, "station "MACSTR" leave, AID=%d",
MAC2STR(event->mac), event->aid);
ESP_LOGI(TAG, "station "MACSTR" leave, AID=%d, reason=%d",
MAC2STR(event->mac), event->aid, event->reason);
}
}

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
@@ -62,8 +62,8 @@ static void wifi_event_handler(void* arg, esp_event_base_t event_base,
{
ESP_LOGI(TAG, "WIFI_EVENT_AP_STADISCONNECTED");
wifi_event_ap_stadisconnected_t* event = (wifi_event_ap_stadisconnected_t*) event_data;
ESP_LOGI(TAG, "station "MACSTR" leave, AID=%d",
MAC2STR(event->mac), event->aid);
ESP_LOGI(TAG, "station "MACSTR" leave, AID=%d, reason=%d",
MAC2STR(event->mac), event->aid, event->reason);
}
break;
case WIFI_EVENT_AP_STACONNECTED:

View File

@@ -56,7 +56,7 @@ static void wifi_event_handler(void *arg, esp_event_base_t event_base,
ESP_LOGI(TAG, "station "MACSTR" join, AID=%d", MAC2STR(event->mac), event->aid);
} else if (event_id == WIFI_EVENT_AP_STADISCONNECTED) {
wifi_event_ap_stadisconnected_t *event = (wifi_event_ap_stadisconnected_t *) event_data;
ESP_LOGI(TAG, "station "MACSTR" leave, AID=%d", MAC2STR(event->mac), event->aid);
ESP_LOGI(TAG, "station "MACSTR" leave, AID=%d, reason=%d", MAC2STR(event->mac), event->aid, event->reason);
}
}