mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-07-28 04:07:47 +00:00
[WiFi] Allow for unprocessed WiFi events to timeout
Fixes nodes not being able to reconnect.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#define ESPEASY_WIFI_SERVICES_INITIALIZED 2
|
||||
|
||||
#define WIFI_RECONNECT_WAIT 20000 // in milliSeconds
|
||||
#define WIFI_CONNECT_TIMEOUT 20000 // in milliSeconds
|
||||
|
||||
bool WiFiEventData_t::WiFiConnectAllowed() const {
|
||||
if (!wifiConnectAttemptNeeded) return false;
|
||||
@@ -33,6 +34,24 @@ bool WiFiEventData_t::unprocessedWifiEvents() const {
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!processedConnect) {
|
||||
if (lastConnectMoment.isSet() && lastConnectMoment.timeoutReached(WIFI_CONNECT_TIMEOUT)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!processedGotIP) {
|
||||
if (lastGetIPmoment.isSet() && lastGetIPmoment.timeoutReached(WIFI_CONNECT_TIMEOUT)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!processedDisconnect) {
|
||||
if (lastDisconnectMoment.isSet() && lastDisconnectMoment.timeoutReached(WIFI_CONNECT_TIMEOUT)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!processedDHCPTimeout) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user