From 8696dc15f151f6488a28f5d7287500309827436f Mon Sep 17 00:00:00 2001 From: xueyunfei Date: Mon, 8 Aug 2022 14:28:07 +0800 Subject: [PATCH] esp_wifi:add clear ap list interface --- components/esp_wifi/include/esp_wifi.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/components/esp_wifi/include/esp_wifi.h b/components/esp_wifi/include/esp_wifi.h index c58ee53fe6..41879009a3 100644 --- a/components/esp_wifi/include/esp_wifi.h +++ b/components/esp_wifi/include/esp_wifi.h @@ -453,6 +453,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 *