|
42 | 42 |
|
43 | 43 | #define MAC_ADDRESS_LENGTH 6
|
44 | 44 |
|
45 |
| -#include "components/log/include/esp_log.h" |
46 |
| - |
47 |
| -static const char* TAG = "wifi"; |
48 |
| - |
49 | 45 | static void start_station(wifi_radio_obj_t *self) {
|
50 | 46 | if (self->sta_mode) {
|
51 | 47 | return;
|
@@ -198,18 +194,15 @@ mp_obj_t common_hal_wifi_radio_get_ap_info(wifi_radio_obj_t *self) {
|
198 | 194 | if (esp_wifi_sta_get_ap_info(&self->ap_info.record) != ESP_OK){
|
199 | 195 | return mp_const_none;
|
200 | 196 | } else {
|
201 |
| - // The struct member appears to be <null> (not NULL!), I don't know how to properly test for it. |
202 |
| - // When the ESP-IDF starts working fine (when their bugfix is available), this "if" wouldn't trigger. |
203 |
| - // Note: It is possible that Wi-Fi APs don't have a CC set, then even after this workaround |
204 |
| - // the element would remain empty. |
205 | 197 | if (strlen(self->ap_info.record.country.cc) == 0) {
|
206 | 198 | // Workaround to fill country related information in ap_info until ESP-IDF carries a fix
|
207 | 199 | // esp_wifi_sta_get_ap_info does not appear to fill wifi_country_t (e.g. country.cc) details
|
208 | 200 | // (IDFGH-4437) #6267
|
209 |
| - if (esp_wifi_get_country(&self->ap_info.record.country) == ESP_OK) { |
210 |
| - ESP_EARLY_LOGW(TAG, "Country Code: %s", self->ap_info.record.country.cc); |
211 |
| - } else { |
212 |
| - ESP_EARLY_LOGW(TAG, "Country Code - Workaround failed!"); |
| 201 | + // Note: It is possible that Wi-Fi APs don't have a CC set, then even after this workaround |
| 202 | + // the element would remain empty. |
| 203 | + memset(&self->ap_info.record.country, 0, sizeof(wifi_country_t)); |
| 204 | + if (esp_wifi_get_country(&self->ap_info.record.country) != ESP_OK) { |
| 205 | + return mp_const_none; |
213 | 206 | }
|
214 | 207 | }
|
215 | 208 | memcpy(&ap_info->record, &self->ap_info.record, sizeof(wifi_ap_record_t));
|
|
0 commit comments