Fix issue #3522 (WiFi does not restart after stopped) (#4114)

This commit fixes issue https://github.com/espressif/arduino-esp32/issues/3522 where WiFi service fails to start after a WiFi.disconnect(true) or a WiFi.mode(WIFI_OFF).
This commit is contained in:
Nikos Mouratidis 2020-09-30 20:34:10 +08:00 committed by GitHub
parent 494061af26
commit 80e9e42c3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -574,7 +574,7 @@ bool WiFiGenericClass::mode(wifi_mode_t m)
*/
wifi_mode_t WiFiGenericClass::getMode()
{
if(!lowLevelInitDone){
if(!lowLevelInitDone || !_esp_wifi_started){
return WIFI_MODE_NULL;
}
wifi_mode_t mode;