kopia lustrzana https://github.com/espressif/esp-idf
Merge branch 'bugfix/update_scan_example_for_scan_get_ap_records' into 'master'
fix(wifi): update scan example for scan get ap records Closes WIFI-6258 and WIFI-6301 See merge request espressif/esp-idf!26524pull/12486/head
commit
199ce4c7a9
|
@ -155,10 +155,11 @@ static void wifi_scan(void)
|
|||
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
|
||||
ESP_ERROR_CHECK(esp_wifi_start());
|
||||
esp_wifi_scan_start(NULL, true);
|
||||
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_LOGI(TAG, "Total APs scanned = %u", ap_count);
|
||||
for (int i = 0; (i < DEFAULT_SCAN_LIST_SIZE) && (i < ap_count); i++) {
|
||||
ESP_LOGI(TAG, "Total APs scanned = %u, actual AP number ap_info holds = %u", ap_count, number);
|
||||
for (int i = 0; i < number; i++) {
|
||||
ESP_LOGI(TAG, "SSID \t\t%s", ap_info[i].ssid);
|
||||
ESP_LOGI(TAG, "RSSI \t\t%d", ap_info[i].rssi);
|
||||
print_auth_mode(ap_info[i].authmode);
|
||||
|
|
Ładowanie…
Reference in New Issue