我看了下lib-esptouch-v2-android的源码, tmp_crc: 38的确是我AP BSSID的CRC.
而且使用以下代码esp32c3也的确能列出AP:
Code: Select all
esp_wifi_scan_start(NULL, true);
ESP_ERROR_CHECK(esp_wifi_scan_get_ap_records(&ap_count, ap_info));
ESP_LOGI(TAG, "Total APs scanned = %u", ap_count);
for (int i = 0; (i < 32) && (i < ap_count); i++) {
ESP_LOGI(TAG, "SSID \t\t%s", ap_info[i].ssid);
ESP_LOGI(TAG, "BSSID \t\t%02x:%02x:%02x:%02x:%02x:%02x",
ap_info[i].bssid[0], ap_info[i].bssid[1], ap_info[i].bssid[2],
ap_info[i].bssid[3], ap_info[i].bssid[4], ap_info[i].bssid[5]);
ESP_LOGI(TAG, "RSSI \t\t%d", ap_info[i].rssi);
print_auth_mode(ap_info[i].authmode);
if (ap_info[i].authmode != WIFI_AUTH_WEP) {
print_cipher_type(ap_info[i].pairwise_cipher, ap_info[i].group_cipher);
}
ESP_LOGI(TAG, "Channel \t\t%d\n", ap_info[i].primary);
}
输出:
Code: Select all
I (2644) smartconfig_example: Total APs scanned = 27
I (2644) smartconfig_example: SSID Mengsk
I (2644) smartconfig_example: BSSID 00:25:9c:13:9e:88
I (2644) smartconfig_example: RSSI -32
I (2654) smartconfig_example: Authmode WIFI_AUTH_WPA2_PSK
I (2654) smartconfig_example: Pairwise Cipher WIFI_CIPHER_TYPE_CCMP
I (2664) smartconfig_example: Group Cipher WIFI_CIPHER_TYPE_CCMP
I (2674) smartconfig_example: Channel 1
I (2674) smartconfig_example: SSID Mengsk-Guest
I (2684) smartconfig_example: BSSID 02:25:9c:13:9e:88
I (2684) smartconfig_example: RSSI -33
I (2694) smartconfig_example: Authmode WIFI_AUTH_WPA2_PSK
I (2694) smartconfig_example: Pairwise Cipher WIFI_CIPHER_TYPE_CCMP
I (2704) smartconfig_example: Group Cipher WIFI_CIPHER_TYPE_CCMP
I (2714) smartconfig_example: Channel 1