Skip to content

BUG: softAPdisconnect return value corruption #3795

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

Closed
tablatronix opened this issue Nov 4, 2017 · 2 comments
Closed

BUG: softAPdisconnect return value corruption #3795

tablatronix opened this issue Nov 4, 2017 · 2 comments

Comments

@tablatronix
Copy link
Contributor

tablatronix commented Nov 4, 2017

Basic Infos

Hardware

Hardware: ESP12e (nodemcu)
Core Version: 2.1.0-rc2

Description

softAPdisconnect return value gets ovewritten when wifioff is true

Sketch

// source
bool ESP8266WiFiAPClass::softAPdisconnect(bool wifioff) {
    bool ret;
    struct softap_config conf;
    *conf.ssid = 0;
    *conf.password = 0;

    ETS_UART_INTR_DISABLE();
    if(WiFi._persistent) {
        ret = wifi_softap_set_config(&conf);
    } else {
        ret = wifi_softap_set_config_current(&conf);
    }
    ETS_UART_INTR_ENABLE();

    if(!ret) {
        DEBUG_WIFI("[APdisconnect] set_config failed!\n");
    }

    if(wifioff) {
        ret = WiFi.enableAP(false); // overwrites ret!!!!
    }

    return ret;
}

if wifi_softap_set_config(_current) returns false and wifioff is true, function will return true (if enableap suceeds of course)

Should bail if if ret is false

    if(ret && wifioff) {
        ret = WiFi.enableAP(false);
    }
tablatronix added a commit to tablatronix/Arduino that referenced this issue Nov 4, 2017
@tablatronix
Copy link
Contributor Author

pr #3796

@tablatronix
Copy link
Contributor Author

This bug could be masking other bugs, eg, #3793
May be breaking!

devyte added a commit to tablatronix/Arduino that referenced this issue Nov 17, 2017
devyte added a commit to tablatronix/Arduino that referenced this issue Nov 17, 2017
devyte added a commit to tablatronix/Arduino that referenced this issue Nov 17, 2017
@devyte devyte closed this as completed in 78b0f44 Nov 17, 2017
tablatronix added a commit to tablatronix/Arduino that referenced this issue Nov 21, 2017
devyte added a commit to tablatronix/Arduino that referenced this issue Nov 22, 2017
devyte pushed a commit that referenced this issue Nov 22, 2017
* fixes #3795

* adds beacon_interval and authmode to softap_config_equal
tablatronix added a commit to tablatronix/Arduino that referenced this issue Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant