mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
Bugfix/persistentchecks (#3798)
* persistent check fixes fixes assumtions that persistent matches current configs, and prevents changes when such conditions exist * oops * fix code compliance block scoping
This commit is contained in:
parent
ac546acb80
commit
0643d6e7ab
@ -129,9 +129,15 @@ bool ESP8266WiFiAPClass::softAP(const char* ssid, const char* passphrase, int ch
|
|||||||
strcpy(reinterpret_cast<char*>(conf.password), passphrase);
|
strcpy(reinterpret_cast<char*>(conf.password), passphrase);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct softap_config conf_current;
|
struct softap_config conf_compare;
|
||||||
wifi_softap_get_config(&conf_current);
|
if(WiFi._persistent){
|
||||||
if(!softap_config_equal(conf, conf_current)) {
|
wifi_softap_get_config_default(&conf_compare);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
wifi_softap_get_config(&conf_compare);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!softap_config_equal(conf, conf_compare)) {
|
||||||
|
|
||||||
ETS_UART_INTR_DISABLE();
|
ETS_UART_INTR_DISABLE();
|
||||||
if(WiFi._persistent) {
|
if(WiFi._persistent) {
|
||||||
|
@ -316,7 +316,11 @@ bool ESP8266WiFiGenericClass::getPersistent(){
|
|||||||
* @param m WiFiMode_t
|
* @param m WiFiMode_t
|
||||||
*/
|
*/
|
||||||
bool ESP8266WiFiGenericClass::mode(WiFiMode_t m) {
|
bool ESP8266WiFiGenericClass::mode(WiFiMode_t m) {
|
||||||
if(wifi_get_opmode() == (uint8) m) {
|
if(_persistent){
|
||||||
|
if(wifi_get_opmode() == (uint8) m && wifi_get_opmode_default() == (uint8) m){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else if(wifi_get_opmode() == (uint8) m){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,9 +138,15 @@ wl_status_t ESP8266WiFiSTAClass::begin(const char* ssid, const char *passphrase,
|
|||||||
conf.bssid_set = 0;
|
conf.bssid_set = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct station_config current_conf;
|
struct station_config conf_compare;
|
||||||
wifi_station_get_config(¤t_conf);
|
if(WiFi._persistent){
|
||||||
if(sta_config_equal(current_conf, conf)) {
|
wifi_station_get_config_default(&conf_compare);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
wifi_station_get_config(&conf_compare);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(sta_config_equal(conf_compare, conf)) {
|
||||||
DEBUGV("sta config unchanged");
|
DEBUGV("sta config unchanged");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user