Skip to content

Bugfix/persistentchecks #3798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 9, 2018
8 changes: 5 additions & 3 deletions libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,11 @@ bool ESP8266WiFiAPClass::softAP(const char* ssid, const char* passphrase, int ch
strcpy(reinterpret_cast<char*>(conf.password), passphrase);
}

struct softap_config conf_current;
wifi_softap_get_config(&conf_current);
if(!softap_config_equal(conf, conf_current)) {
struct softap_config conf_compare;
if(WiFi._persistent) wifi_softap_get_config_default(&conf_compare);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indentation

else wifi_softap_get_config(&conf_compare);

if(!softap_config_equal(conf, conf_compare)) {

ETS_UART_INTR_DISABLE();
if(WiFi._persistent) {
Expand Down
6 changes: 5 additions & 1 deletion libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,11 @@ void ESP8266WiFiGenericClass::persistent(bool persistent) {
* @param m WiFiMode_t
*/
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;
}

Expand Down
8 changes: 5 additions & 3 deletions libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,11 @@ wl_status_t ESP8266WiFiSTAClass::begin(const char* ssid, const char *passphrase,
conf.bssid_set = 0;
}

struct station_config current_conf;
wifi_station_get_config(&current_conf);
if(sta_config_equal(current_conf, conf)) {
struct station_config conf_compare;
if(WiFi._persistent) wifi_station_get_config_default(&conf_compare);
else wifi_station_get_config(&conf_compare);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean add brackets, or is it using tabs ?


if(sta_config_equal(conf_compare, conf)) {
DEBUGV("sta config unchanged");
}
else {
Expand Down