Skip to content

Commit 06043bb

Browse files
committed
Bugfix: lastConnectionTickTime was not always updated correctly, due to the usage of 'return' statements within the switch-case statements
1 parent a80960d commit 06043bb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Arduino_WiFiConnectionHandler.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ void WiFiConnectionHandler::update() {
104104
int networkStatus = 0;
105105
if (now - lastConnectionTickTime > connectionTickTimeInterval) { /* time bracket */
106106

107+
lastConnectionTickTime = now;
108+
107109
switch (netConnectionState) {
108110
case NetworkConnectionState::INIT: {
109111
Debug.print(DBG_VERBOSE, "::INIT");
@@ -114,7 +116,6 @@ void WiFiConnectionHandler::update() {
114116
if (networkStatus == NETWORK_HARDWARE_ERROR) {
115117
// NO FURTHER ACTION WILL FOLLOW THIS
116118
changeConnectionState(NetworkConnectionState::ERROR);
117-
lastConnectionTickTime = now;
118119
return;
119120
}
120121
Debug.print(DBG_ERROR, "Current WiFi Firmware: %s", WiFi.firmwareVersion());
@@ -209,8 +210,6 @@ void WiFiConnectionHandler::update() {
209210
}
210211
break;
211212
}
212-
lastConnectionTickTime = now;
213-
214213
} /* time bracket */
215214
}
216215

0 commit comments

Comments
 (0)