@@ -198,55 +198,20 @@ mp_obj_t common_hal_wifi_radio_get_ap_info(wifi_radio_obj_t *self) {
198
198
if (esp_wifi_sta_get_ap_info (& self -> ap_info .record ) != ESP_OK ){
199
199
return mp_const_none ;
200
200
} else {
201
- ESP_EARLY_LOGW (TAG , "country before handler country: %s" , (char * )& self -> ap_info .record .country );
202
- ESP_EARLY_LOGW (TAG , "country memory at: %p" , self -> ap_info .record .country );
203
- ESP_EARLY_LOGW (TAG , "countryCC memory at: %p" , self -> ap_info .record .country .cc );
204
- ESP_EARLY_LOGW (TAG , "countryCC strlen: %d" , strlen (self -> ap_info .record .country .cc ));
205
201
// The struct member appears to be <null> (not NULL!), I don't know how to properly test for it.
206
- // If the ESP-IDF starts working fine, this "if" wouldn't trigger.
202
+ // When the ESP-IDF starts working fine (when their bugfix is available) , this "if" wouldn't trigger.
207
203
// Note: It is possible that Wi-Fi APs don't have a CC set, then even after this workaround
208
204
// the element would remain empty.
209
205
if (strlen (self -> ap_info .record .country .cc ) == 0 ) {
210
206
// Workaround to fill country related information in ap_info until ESP-IDF carries a fix
211
207
// esp_wifi_sta_get_ap_info does not appear to fill wifi_country_t (e.g. country.cc) details
212
208
// (IDFGH-4437) #6267
213
- ESP_EARLY_LOGW (TAG , "Triggered missing country workaround" );
214
209
if (esp_wifi_get_country (& self -> ap_info .record .country ) == ESP_OK ) {
215
- ESP_EARLY_LOGW (TAG , "Workaround worked fine!" );
216
- ESP_EARLY_LOGW (TAG , "country: %d" , self -> ap_info .record .country );
217
- ESP_EARLY_LOGW (TAG , "CC: %s" , self -> ap_info .record .country .cc );
210
+ ESP_EARLY_LOGW (TAG , "Country Code: %s" , self -> ap_info .record .country .cc );
218
211
} else {
219
- ESP_EARLY_LOGW (TAG , "Workaround failed!" );
212
+ ESP_EARLY_LOGW (TAG , "Country Code - Workaround failed!" );
220
213
}
221
- //} else {
222
- // ESP_EARLY_LOGW(TAG, "Triggered missing country workaround IN ELSE");
223
- // //memset(&self->ap_info.record.country, 0, sizeof(wifi_country_t));
224
- // if (esp_wifi_get_country(&self->ap_info.record.country) == ESP_OK) {
225
- // //if (esp_wifi_get_country(&self->ap_info.record.country) == ESP_OK) {
226
- // ESP_EARLY_LOGW(TAG, "Workaround worked fine!");
227
- // ESP_EARLY_LOGW(TAG, "CC: %s", self->ap_info.record.country.cc);
228
- // } else {
229
- // ESP_EARLY_LOGW(TAG, "Workaround failed!");
230
- // }
231
214
}
232
- ESP_EARLY_LOGW (TAG , "ssid: %s" , self -> ap_info .record .ssid );
233
- ESP_EARLY_LOGW (TAG , "channel: %d" , self -> ap_info .record .primary );
234
- ESP_EARLY_LOGW (TAG , "secondary: %d" , self -> ap_info .record .second );
235
- ESP_EARLY_LOGW (TAG , "rssi: %d" , self -> ap_info .record .rssi );
236
- ESP_EARLY_LOGW (TAG , "authmode: %d" , self -> ap_info .record .authmode );
237
- ESP_EARLY_LOGW (TAG , "pairwise_cipher: %d" , self -> ap_info .record .pairwise_cipher );
238
- ESP_EARLY_LOGW (TAG , "group_cipher: %d" , self -> ap_info .record .group_cipher );
239
- ESP_EARLY_LOGW (TAG , "11b: %d" , self -> ap_info .record .phy_11b );
240
- ESP_EARLY_LOGW (TAG , "11g: %d" , self -> ap_info .record .phy_11g );
241
- ESP_EARLY_LOGW (TAG , "11n: %d" , self -> ap_info .record .phy_11n );
242
- ESP_EARLY_LOGW (TAG , "phy_lr: %d" , self -> ap_info .record .phy_lr );
243
- ESP_EARLY_LOGW (TAG , "ap_info.record: %s" , self -> ap_info .record );
244
- ESP_EARLY_LOGW (TAG , "country with cast: %s" , (char * )& self -> ap_info .record .country );
245
- //ESP_EARLY_LOGW(TAG, "country: %s", self->ap_info.record.country);
246
- ESP_EARLY_LOGW (TAG , "country memory at: %p" , self -> ap_info .record .country );
247
- ESP_EARLY_LOGW (TAG , "countryCC: %s" , self -> ap_info .record .country .cc );
248
- ESP_EARLY_LOGW (TAG , "countryCC memory at: %p" , self -> ap_info .record .country .cc );
249
- ESP_EARLY_LOGW (TAG , "countryCC strlen: %d" , strlen (self -> ap_info .record .country .cc ));
250
215
memcpy (& ap_info -> record , & self -> ap_info .record , sizeof (wifi_ap_record_t ));
251
216
return MP_OBJ_FROM_PTR (ap_info );
252
217
}
0 commit comments