Change disconnect function (#466)

* Change disconnect function

Current implementation does not disconnect the WiFi. Use of `esp_wifi_disconnect()` does.

* Update WiFiSTA.cpp

put back the clear ssid + password
remove the duplicate `esp_wifi_set_config(WIFI_IF_STA, &conf);`
This commit is contained in:
sticilface 2017-08-01 10:59:52 +01:00 committed by Me No Dev
parent f54b0fcd14
commit 91d02cc6d5

View File

@ -262,7 +262,7 @@ bool WiFiSTAClass::disconnect(bool wifioff)
WiFi.getMode();
esp_wifi_start();
esp_wifi_set_config(WIFI_IF_STA, &conf);
ret = esp_wifi_set_config(WIFI_IF_STA, &conf) == ESP_OK;
ret = esp_wifi_disconnect() == ESP_OK;
if(wifioff) {
WiFi.enableSTA(false);