From e9c9fce15ddf292763cf4375c6e5e0c3f25d9e35 Mon Sep 17 00:00:00 2001 From: BennyE Date: Wed, 23 Dec 2020 14:59:09 +0100 Subject: [PATCH] Remove debug log messages --- ports/esp32s2/common-hal/wifi/Radio.c | 41 ++----------------- .../esp32s2/common-hal/wifi/ScannedNetworks.c | 6 --- 2 files changed, 3 insertions(+), 44 deletions(-) diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index 08d8bbcd50..d4db5d08d3 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -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){ return mp_const_none; } 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 (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 // the element would remain empty. if (strlen(self->ap_info.record.country.cc) == 0) { // 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 // (IDFGH-4437) #6267 - ESP_EARLY_LOGW(TAG, "Triggered missing country workaround"); if (esp_wifi_get_country(&self->ap_info.record.country) == ESP_OK) { - ESP_EARLY_LOGW(TAG, "Workaround worked fine!"); - ESP_EARLY_LOGW(TAG, "country: %d", self->ap_info.record.country); - ESP_EARLY_LOGW(TAG, "CC: %s", self->ap_info.record.country.cc); + ESP_EARLY_LOGW(TAG, "Country Code: %s", self->ap_info.record.country.cc); } 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)); return MP_OBJ_FROM_PTR(ap_info); } diff --git a/ports/esp32s2/common-hal/wifi/ScannedNetworks.c b/ports/esp32s2/common-hal/wifi/ScannedNetworks.c index 0540ffc5cc..cc733308db 100644 --- a/ports/esp32s2/common-hal/wifi/ScannedNetworks.c +++ b/ports/esp32s2/common-hal/wifi/ScannedNetworks.c @@ -39,10 +39,6 @@ #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) { self->done = true; 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); 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)); self->current_result++;