Add JSON API for AP toggle
This commit is contained in:
@@ -889,11 +889,14 @@ void WLED::handleConnection()
|
||||
DEBUG_PRINTLN(F("Not connected AP."));
|
||||
initAP(); // start AP only within first 5min
|
||||
}
|
||||
} if (apActive && apBehavior == AP_BEHAVIOR_BOOT_NO_CONN_5MIN && now > 300000 && stac == 0) { // disconnect AP after 5min
|
||||
dnsServer.stop();
|
||||
WiFi.softAPdisconnect(true);
|
||||
apActive = false;
|
||||
DEBUG_PRINTLN(F("Access point disabled (after 5min)."));
|
||||
} if (apActive && apBehavior == AP_BEHAVIOR_BOOT_NO_CONN_5MIN && now > 300000 && stac == 0) { // disconnect AP after 5min if no clients connected
|
||||
// if AP was enabled more than 10min after boot or if client was connected more than 10min after boot do not disconnect AP mode
|
||||
if (now < 600000) {
|
||||
dnsServer.stop();
|
||||
WiFi.softAPdisconnect(true);
|
||||
apActive = false;
|
||||
DEBUG_PRINTLN(F("Access point disabled (after 5min)."));
|
||||
}
|
||||
}
|
||||
} else if (!interfacesInited) { //newly connected
|
||||
DEBUG_PRINTLN("");
|
||||
|
||||
Reference in New Issue
Block a user