feat(wifi): add itwt teardown status

This commit is contained in:
xuxiao 2024-05-07 19:07:24 +08:00 committed by jack
parent beebbada64
commit e11f030427
3 changed files with 16 additions and 3 deletions

View File

@ -302,9 +302,18 @@ typedef struct {
uint64_t target_wake_time; /**< TWT SP start time */ uint64_t target_wake_time; /**< TWT SP start time */
} wifi_event_sta_itwt_setup_t; } wifi_event_sta_itwt_setup_t;
/**
* @brief iTWT teardown status
*/
typedef enum {
ITWT_TEARDOWN_FAIL, /**< station sends teardown frame fail */
ITWT_TEARDOWN_SUCCESS, /**< 1) station successfully sends teardown frame to AP; 2) station receives teardown frame from AP */
} wifi_itwt_teardown_status_t;
/** Argument structure for WIFI_EVENT_TWT_TEARDOWN event */ /** Argument structure for WIFI_EVENT_TWT_TEARDOWN event */
typedef struct { typedef struct {
uint8_t flow_id; /**< flow id */ uint8_t flow_id; /**< flow id */
wifi_itwt_teardown_status_t status; /**< itwt teardown status */
} wifi_event_sta_itwt_teardown_t; } wifi_event_sta_itwt_teardown_t;
/** /**

@ -1 +1 @@
Subproject commit 6aa93ec85df32b54dc91c44bb0ef2d5319f757cb Subproject commit 321823002fd7aa2d76b9996b95336495011525db

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Unlicense OR CC0-1.0 * SPDX-License-Identifier: Unlicense OR CC0-1.0
*/ */
@ -183,7 +183,11 @@ static void itwt_teardown_handler(void *arg, esp_event_base_t event_base,
int32_t event_id, void *event_data) int32_t event_id, void *event_data)
{ {
wifi_event_sta_itwt_teardown_t *teardown = (wifi_event_sta_itwt_teardown_t *) event_data; wifi_event_sta_itwt_teardown_t *teardown = (wifi_event_sta_itwt_teardown_t *) event_data;
ESP_LOGI(TAG, "<WIFI_EVENT_ITWT_TEARDOWN>flow_id %d%s", teardown->flow_id, (teardown->flow_id == 8) ? "(all twt)" : ""); if (teardown->status == ITWT_TEARDOWN_FAIL) {
ESP_LOGE(TAG, "<WIFI_EVENT_ITWT_TEARDOWN>flow_id %d%s, twt teardown frame tx failed", teardown->flow_id, (teardown->flow_id == 8) ? "(all twt)" : "");
} else {
ESP_LOGI(TAG, "<WIFI_EVENT_ITWT_TEARDOWN>flow_id %d%s", teardown->flow_id, (teardown->flow_id == 8) ? "(all twt)" : "");
}
} }
static void itwt_suspend_handler(void *arg, esp_event_base_t event_base, static void itwt_suspend_handler(void *arg, esp_event_base_t event_base,