forked from espressif/esp-idf
fix(wifi): fixed scan get ap number issue
This commit is contained in:
@ -153,8 +153,8 @@ static void wifi_scan(void)
|
|||||||
ESP_ERROR_CHECK(esp_wifi_start());
|
ESP_ERROR_CHECK(esp_wifi_start());
|
||||||
esp_wifi_scan_start(NULL, true);
|
esp_wifi_scan_start(NULL, true);
|
||||||
ESP_LOGI(TAG, "Max AP number ap_info can hold = %u", number);
|
ESP_LOGI(TAG, "Max AP number ap_info can hold = %u", number);
|
||||||
ESP_ERROR_CHECK(esp_wifi_scan_get_ap_records(&number, ap_info));
|
|
||||||
ESP_ERROR_CHECK(esp_wifi_scan_get_ap_num(&ap_count));
|
ESP_ERROR_CHECK(esp_wifi_scan_get_ap_num(&ap_count));
|
||||||
|
ESP_ERROR_CHECK(esp_wifi_scan_get_ap_records(&number, ap_info));
|
||||||
ESP_LOGI(TAG, "Total APs scanned = %u, actual AP number ap_info holds = %u", ap_count, number);
|
ESP_LOGI(TAG, "Total APs scanned = %u, actual AP number ap_info holds = %u", ap_count, number);
|
||||||
for (int i = 0; i < number; i++) {
|
for (int i = 0; i < number; i++) {
|
||||||
ESP_LOGI(TAG, "SSID \t\t%s", ap_info[i].ssid);
|
ESP_LOGI(TAG, "SSID \t\t%s", ap_info[i].ssid);
|
||||||
|
Reference in New Issue
Block a user