Skip to content

Commit 59cbe71

Browse files
committed
ESP32: SSID named "OFF" will turn all WIFI off
1 parent f249e79 commit 59cbe71

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

WifiESP32.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,11 @@ bool WifiESP::setup(const char *SSid,
170170
uint8_t tries = 40;
171171
if (wifiUp)
172172
teardown();
173-
173+
if (strcmp("OFF", SSid) == 0) {
174+
WiFi.disconnect(true);
175+
WiFi.mode(WIFI_OFF);
176+
return false; // debatable if that is true (success) or false (no network)
177+
}
174178
//#ifdef SERIAL_BT_COMMANDS
175179
//return false;
176180
//#endif

0 commit comments

Comments
 (0)