Wifi scanning

This commit is contained in:
Martin Bauer
2021-06-06 15:56:30 +02:00
parent 26d3469c83
commit fdfd26307e
10 changed files with 846 additions and 380 deletions

View File

@@ -78,12 +78,13 @@ void WifiManager::resetToApProvisioning()
prefs_.remove("staPassword");
}
void WifiManager::wifiWatchdog()
void WifiManager::iteration()
{
if (state_ == STA && WiFi.status() != WL_CONNECTED) {
startWifi();
Serial.println("Connection lost - Restarting WIFI");
}
}

View File

@@ -14,7 +14,7 @@
*
* When operating in access point mode, the device IP is 192.168.42.1
*
* call wifiWatchdog regularly to reconnect in station mode if connection was lost
* call iteration() regularly, it has a wifiWatchdog to reconnect in station mode if connection was lost
*/
class WifiManager
{
@@ -34,7 +34,7 @@ public:
void setApCredentials(const char *password);
void resetToApProvisioning();
void wifiWatchdog();
void iteration();
bool inProvisioningMode() const { return state_ == INVALID || state_ == AP_PROVISIONING; }