implement feature to disable wifi / wifi config portal fallback

This commit is contained in:
technyon
2024-01-30 14:26:17 +01:00
parent b733a0e7d6
commit 6c6174fdb2
8 changed files with 24 additions and 1 deletions

View File

@@ -65,6 +65,14 @@ void Network::setupDevice()
if(strcmp(WiFi_fallbackDetect, "wifi_fallback") == 0)
{
if(_preferences->getBool(preference_network_wifi_fallback_disabled))
{
Log->println(F("Failed to connect to network. Wifi fallback is disable, rebooting."));
memset(WiFi_fallbackDetect, 0, sizeof(WiFi_fallbackDetect));
sleep(5);
restartEsp(RestartReason::NetworkDeviceCriticalFailureNoWifiFallback);
}
Log->println(F("Switching to WiFi device as fallback."));
_networkDeviceType = NetworkDeviceType::WiFi;
}