diff --git a/components/esp_wifi/include/esp_wifi.h b/components/esp_wifi/include/esp_wifi.h index d16b3c841b..337458fb7d 100644 --- a/components/esp_wifi/include/esp_wifi.h +++ b/components/esp_wifi/include/esp_wifi.h @@ -463,6 +463,21 @@ esp_err_t esp_wifi_scan_get_ap_num(uint16_t *number); esp_err_t esp_wifi_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_records); +/** + * @brief Clear AP list found in last scan + * + * @attention When the obtained ap list fails,bss info must be cleared,otherwise it may cause memory leakage. + * + * @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_WIFI_MODE: WiFi mode is wrong + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_clear_ap_list(void); + + /** * @brief Get information of AP which the ESP32 station is associated with * diff --git a/docs/en/api-guides/wifi.rst b/docs/en/api-guides/wifi.rst index b5a589f3df..eebf3257ad 100644 --- a/docs/en/api-guides/wifi.rst +++ b/docs/en/api-guides/wifi.rst @@ -1267,6 +1267,7 @@ but the connected AP has country info:: .schan = 1, .nchan = 13, }; + then country info of connected AP's is used. Following table depicts which country info is used in different Wi-Fi Mode and different country policy, also describe the impact to active scan.