adds temporary fallbacks for esp32 set country

Find better way to check version feature check, arduino ver is not always available.
This commit is contained in:
tablatronix
2022-08-09 10:59:33 -05:00
parent 5ded0c9ef8
commit 58baeaba6f
3 changed files with 17 additions and 3 deletions
+8 -2
View File
@@ -3457,8 +3457,14 @@ bool WiFiManager::WiFiSetCountry(){
// If an invalid country code is passed, ESP_ERR_WIFI_ARG will be returned
// This also uses 802.11d mode, which matches the STA to the country code of the AP it connects to (meaning
// that the country code will be overridden if connecting to a "foreign" AP)
else err = esp_wifi_set_country_code(_wificountry.c_str(), true);
else {
#ifndef WM_NOCOUNTRY
err = esp_wifi_set_country_code(_wificountry.c_str(), true);
#else
DEBUG_WM(DEBUG_ERROR,"[ERROR] esp wifi set country is not available");
err = true;
#endif
}
#ifdef WM_DEBUG_LEVEL
if(err){
if(err == ESP_ERR_WIFI_NOT_INIT) DEBUG_WM(DEBUG_ERROR,"[ERROR] ESP_ERR_WIFI_NOT_INIT");
+8
View File
@@ -638,10 +638,18 @@ class WiFiManager
#define WM_ARDUINOEVENTS
#else
#define WM_NOSOFTAPSSID
#define WM_NOCOUNTRY
#endif
#else
#define WM_NOCOUNTRY
#endif
#ifdef WM_NOCOUNTRY
#warning "ESP32 set country unavailable"
#endif
#ifdef WM_ARDUINOEVENTS
void WiFiEvent(WiFiEvent_t event, arduino_event_info_t info);
#else
@@ -219,7 +219,7 @@ void setup() {
// setting wifi country seems to improve OSX soft ap connectivity,
// may help others as well, default is CN which has different channels
// wm.setCountry("US"); // crashing on esp32 2.0
wm.setCountry("US"); // crashing on esp32 2.0
// set Hostname