mirror of
https://github.com/tbnobody/OpenDTU.git
synced 2025-12-11 01:10:20 +01:00
Move disableAdminMode to separate method
This commit is contained in:
@@ -64,6 +64,7 @@ private:
|
||||
void handleMDNS();
|
||||
void setupMode();
|
||||
void NetworkEvent(const WiFiEvent_t event, WiFiEventInfo_t info);
|
||||
void disableAdminMode();
|
||||
|
||||
Task _loopTask;
|
||||
|
||||
|
||||
@@ -206,6 +206,13 @@ void NetworkSettingsClass::enableAdminMode()
|
||||
setupMode();
|
||||
}
|
||||
|
||||
void NetworkSettingsClass::disableAdminMode()
|
||||
{
|
||||
_adminEnabled = false;
|
||||
MessageOutput.printf("Admin mode disabled\r\n");
|
||||
setupMode();
|
||||
}
|
||||
|
||||
String NetworkSettingsClass::getApName() const
|
||||
{
|
||||
return String(ACCESS_POINT_NAME + String(Utils::getChipId()));
|
||||
@@ -249,9 +256,7 @@ void NetworkSettingsClass::loop()
|
||||
// If WiFi is connected to AP for more than adminTimeoutCounterMax
|
||||
// seconds, disable the internal Access Point
|
||||
if (_adminTimeoutCounter > _adminTimeoutCounterMax) {
|
||||
_adminEnabled = false;
|
||||
MessageOutput.printf("Admin mode disabled\r\n");
|
||||
setupMode();
|
||||
disableAdminMode();
|
||||
}
|
||||
// It's nearly not possible to use the internal AP if the
|
||||
// WiFi is searching for an AP. So disable searching afer
|
||||
|
||||
Reference in New Issue
Block a user