Remove debug log messages

This commit is contained in:
BennyE 2020-12-23 14:59:09 +01:00
parent ae3b440835
commit e9c9fce15d
2 changed files with 3 additions and 44 deletions

View File

@ -198,55 +198,20 @@ mp_obj_t common_hal_wifi_radio_get_ap_info(wifi_radio_obj_t *self) {
if (esp_wifi_sta_get_ap_info(&self->ap_info.record) != ESP_OK){ if (esp_wifi_sta_get_ap_info(&self->ap_info.record) != ESP_OK){
return mp_const_none; return mp_const_none;
} else { } else {
ESP_EARLY_LOGW(TAG, "country before handler country: %s", (char *)&self->ap_info.record.country);
ESP_EARLY_LOGW(TAG, "country memory at: %p", self->ap_info.record.country);
ESP_EARLY_LOGW(TAG, "countryCC memory at: %p", self->ap_info.record.country.cc);
ESP_EARLY_LOGW(TAG, "countryCC strlen: %d", strlen(self->ap_info.record.country.cc));
// The struct member appears to be <null> (not NULL!), I don't know how to properly test for it. // The struct member appears to be <null> (not NULL!), I don't know how to properly test for it.
// If the ESP-IDF starts working fine, this "if" wouldn't trigger. // When the ESP-IDF starts working fine (when their bugfix is available), this "if" wouldn't trigger.
// Note: It is possible that Wi-Fi APs don't have a CC set, then even after this workaround // Note: It is possible that Wi-Fi APs don't have a CC set, then even after this workaround
// the element would remain empty. // the element would remain empty.
if (strlen(self->ap_info.record.country.cc) == 0) { if (strlen(self->ap_info.record.country.cc) == 0) {
// Workaround to fill country related information in ap_info until ESP-IDF carries a fix // Workaround to fill country related information in ap_info until ESP-IDF carries a fix
// esp_wifi_sta_get_ap_info does not appear to fill wifi_country_t (e.g. country.cc) details // esp_wifi_sta_get_ap_info does not appear to fill wifi_country_t (e.g. country.cc) details
// (IDFGH-4437) #6267 // (IDFGH-4437) #6267
ESP_EARLY_LOGW(TAG, "Triggered missing country workaround");
if (esp_wifi_get_country(&self->ap_info.record.country) == ESP_OK) { if (esp_wifi_get_country(&self->ap_info.record.country) == ESP_OK) {
ESP_EARLY_LOGW(TAG, "Workaround worked fine!"); ESP_EARLY_LOGW(TAG, "Country Code: %s", self->ap_info.record.country.cc);
ESP_EARLY_LOGW(TAG, "country: %d", self->ap_info.record.country);
ESP_EARLY_LOGW(TAG, "CC: %s", self->ap_info.record.country.cc);
} else { } else {
ESP_EARLY_LOGW(TAG, "Workaround failed!"); ESP_EARLY_LOGW(TAG, "Country Code - Workaround failed!");
} }
//} else {
// ESP_EARLY_LOGW(TAG, "Triggered missing country workaround IN ELSE");
// //memset(&self->ap_info.record.country, 0, sizeof(wifi_country_t));
// if (esp_wifi_get_country(&self->ap_info.record.country) == ESP_OK) {
// //if (esp_wifi_get_country(&self->ap_info.record.country) == ESP_OK) {
// ESP_EARLY_LOGW(TAG, "Workaround worked fine!");
// ESP_EARLY_LOGW(TAG, "CC: %s", self->ap_info.record.country.cc);
// } else {
// ESP_EARLY_LOGW(TAG, "Workaround failed!");
// }
} }
ESP_EARLY_LOGW(TAG, "ssid: %s", self->ap_info.record.ssid);
ESP_EARLY_LOGW(TAG, "channel: %d", self->ap_info.record.primary);
ESP_EARLY_LOGW(TAG, "secondary: %d", self->ap_info.record.second);
ESP_EARLY_LOGW(TAG, "rssi: %d", self->ap_info.record.rssi);
ESP_EARLY_LOGW(TAG, "authmode: %d", self->ap_info.record.authmode);
ESP_EARLY_LOGW(TAG, "pairwise_cipher: %d", self->ap_info.record.pairwise_cipher);
ESP_EARLY_LOGW(TAG, "group_cipher: %d", self->ap_info.record.group_cipher);
ESP_EARLY_LOGW(TAG, "11b: %d", self->ap_info.record.phy_11b);
ESP_EARLY_LOGW(TAG, "11g: %d", self->ap_info.record.phy_11g);
ESP_EARLY_LOGW(TAG, "11n: %d", self->ap_info.record.phy_11n);
ESP_EARLY_LOGW(TAG, "phy_lr: %d", self->ap_info.record.phy_lr);
ESP_EARLY_LOGW(TAG, "ap_info.record: %s", self->ap_info.record);
ESP_EARLY_LOGW(TAG, "country with cast: %s", (char *)&self->ap_info.record.country);
//ESP_EARLY_LOGW(TAG, "country: %s", self->ap_info.record.country);
ESP_EARLY_LOGW(TAG, "country memory at: %p", self->ap_info.record.country);
ESP_EARLY_LOGW(TAG, "countryCC: %s", self->ap_info.record.country.cc);
ESP_EARLY_LOGW(TAG, "countryCC memory at: %p", self->ap_info.record.country.cc);
ESP_EARLY_LOGW(TAG, "countryCC strlen: %d", strlen(self->ap_info.record.country.cc));
memcpy(&ap_info->record, &self->ap_info.record, sizeof(wifi_ap_record_t)); memcpy(&ap_info->record, &self->ap_info.record, sizeof(wifi_ap_record_t));
return MP_OBJ_FROM_PTR(ap_info); return MP_OBJ_FROM_PTR(ap_info);
} }

View File

@ -39,10 +39,6 @@
#include "components/esp_wifi/include/esp_wifi.h" #include "components/esp_wifi/include/esp_wifi.h"
#include "components/log/include/esp_log.h"
static const char* TAG = "wifi";
static void wifi_scannednetworks_done(wifi_scannednetworks_obj_t *self) { static void wifi_scannednetworks_done(wifi_scannednetworks_obj_t *self) {
self->done = true; self->done = true;
if (self->results != NULL) { if (self->results != NULL) {
@ -121,8 +117,6 @@ mp_obj_t common_hal_wifi_scannednetworks_next(wifi_scannednetworks_obj_t *self)
wifi_network_obj_t *entry = m_new_obj(wifi_network_obj_t); wifi_network_obj_t *entry = m_new_obj(wifi_network_obj_t);
entry->base.type = &wifi_network_type; entry->base.type = &wifi_network_type;
// benny remove again
ESP_EARLY_LOGW(TAG, "scan country: %s", &self->results[self->current_result].country);
memcpy(&entry->record, &self->results[self->current_result], sizeof(wifi_ap_record_t)); memcpy(&entry->record, &self->results[self->current_result], sizeof(wifi_ap_record_t));
self->current_result++; self->current_result++;