This commit is contained in:
tablatronix
2018-07-22 10:41:50 -05:00
parent afbad01ee1
commit 2c41af00f5
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -2334,9 +2334,9 @@ String WiFiManager::getModeString(uint8_t mode){
return FPSTR(S_NA);
}
bool WiFiManager::WiFiSetCountry(){
bool ret = false;
#ifdef ESP32
// @todo check if wifi is init, no idea how, doesnt seem to be exposed
if(_wificountry == "") return ret; // skip not set
else if(WiFi.getMode() == WIFI_MODE_NULL); // exception if wifi not init!
@@ -2347,9 +2347,11 @@ bool WiFiManager::WiFiSetCountry(){
if(ret) DEBUG_WM(DEBUG_VERBOSE,"esp_wifi_set_country: " + _wificountry);
else DEBUG_WM(DEBUG_ERROR,"[ERROR] esp_wifi_set_country failed");
#endif
return ret;
}
// set mode ignores WiFi.persistent
bool WiFiManager::WiFi_Mode(WiFiMode_t m,bool persistent) {
bool ret;
+3 -1
View File
@@ -319,6 +319,8 @@ const char * const AUTH_MODE_NAMES[] PROGMEM
const char* const WIFI_MODES[] PROGMEM = { "NULL", "STA", "AP", "STA+AP" };
#ifdef esp32
const wifi_country_t WM_COUNTRY_US{"US",1,11,WIFI_COUNTRY_POLICY_AUTO};
const wifi_country_t WM_COUNTRY_CN{"CN",1,13,WIFI_COUNTRY_POLICY_AUTO};
const wifi_country_t WM_COUNTRY_JP{"JP",1,14,WIFI_COUNTRY_POLICY_AUTO};
const wifi_country_t WM_COUNTRY_JP{"JP",1,14,WIFI_COUNTRY_POLICY_AUTO};
#endif