diff --git a/components/esp_wifi/include/esp_wifi_he.h b/components/esp_wifi/include/esp_wifi_he.h index 0eba6ad5c9..d7a8a4079d 100644 --- a/components/esp_wifi/include/esp_wifi_he.h +++ b/components/esp_wifi/include/esp_wifi_he.h @@ -180,17 +180,32 @@ esp_err_t esp_wifi_sta_btwt_setup(wifi_btwt_setup_config_t *config); */ esp_err_t esp_wifi_sta_btwt_teardown(uint8_t btwt_id); +/** + * @brief Get number of btwts supported by the connected AP + * + * @param[out] btwt_number store number of btwts supported by the connected AP + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_sta_get_btwt_num(uint8_t *btwt_number); + /** * @brief Get broadcast TWT information * - * @param[in] btwt_info pointer to bTWT information structure. + * @param[inout] btwt_number As input param, it stores max btwt number AP supported. + * As output param, it receives the actual btwt numbers AP supported. + * @param[in] btwt_info array to hold the btwt information supported by AP * * @return * - ESP_OK: succeed * - ESP_FAIL: fail * - ESP_ERR_WIFI_CONN: WiFi internal error, station or soft-AP control block wrong */ -esp_err_t esp_wifi_sta_btwt_get_info(esp_wifi_btwt_info_t *btwt_info); +esp_err_t esp_wifi_sta_btwt_get_info(uint8_t btwt_number, esp_wifi_btwt_info_t *btwt_info); /** * @brief Set wifi TWT config diff --git a/components/esp_wifi/include/esp_wifi_he_types.h b/components/esp_wifi/include/esp_wifi_he_types.h index 1d31f56131..b50889254d 100644 --- a/components/esp_wifi/include/esp_wifi_he_types.h +++ b/components/esp_wifi/include/esp_wifi_he_types.h @@ -412,6 +412,7 @@ typedef struct { uint8_t flow_id; /**< flow id */ } wifi_event_sta_twt_wakeup_t; +/** Argument structure for twt information */ typedef struct { bool btwt_id_in_use; /**< indicate whether the btwt id is in use or not */ uint16_t btwt_trigger : 1; /**< 1: a trigger-enabled TWT, 0: a non-trigger-enabled TWT */