Skip to content

Commit 61c0e29

Browse files
committed
Move execution of _on_connected_event_callback from update_handleGetTime to update_handleConnecting
1 parent 9dbc807 commit 61c0e29

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
@@ -253,6 +253,8 @@ void WiFiConnectionHandler::update_handleConnecting(int & networkStatus) {
253253
}
254254
else {
255255
Debug.print(DBG_INFO, "Connected to \"%s\"", ssid);
256+
execNetworkEventCallback(_on_connect_event_callback, 0);
257+
connectionTickTimeInterval = CHECK_INTERVAL_CONNECTED;
256258
changeConnectionState(NetworkConnectionState::GETTIME);
257259
return;
258260
}
@@ -274,9 +276,6 @@ NetworkConnectionState WiFiConnectionHandler::update_handleGetTime() {
274276
#ifdef BOARD_ESP8266
275277
configTime(0, 0, "time.arduino.cc", "pool.ntp.org", "time.nist.gov");
276278
#endif
277-
/* Transition to NetworkConnectionState::CONNECTED */
278-
execNetworkEventCallback(_on_connect_event_callback, 0);
279-
connectionTickTimeInterval = CHECK_INTERVAL_CONNECTED;
280279
return NetworkConnectionState::CONNECTED;
281280
}
282281

0 commit comments

Comments
 (0)