@@ -79,7 +79,7 @@ NetworkConnectionState WiFiConnectionHandler::check()
7979 case NetworkConnectionState::INIT: _netConnectionState = update_handleInit (); break ;
8080 case NetworkConnectionState::CONNECTING: _netConnectionState = update_handleConnecting (); break ;
8181 case NetworkConnectionState::CONNECTED: _netConnectionState = update_handleConnected (); break ;
82- case NetworkConnectionState::GETTIME: _netConnectionState = update_handleGetTime (); break ;
82+ case NetworkConnectionState::GETTIME: /* Unused */ break ;
8383 case NetworkConnectionState::DISCONNECTING: _netConnectionState = update_handleDisconnecting (); break ;
8484 case NetworkConnectionState::DISCONNECTED: _netConnectionState = update_handleDisconnected (); break ;
8585 case NetworkConnectionState::ERROR: break ;
@@ -144,7 +144,10 @@ NetworkConnectionState WiFiConnectionHandler::update_handleConnecting()
144144 {
145145 Debug.print (DBG_INFO, " Connected to \" %s\" " , _ssid);
146146 execCallback (NetworkConnectionEvent::CONNECTED);
147- return NetworkConnectionState::GETTIME;
147+ #ifdef BOARD_ESP8266
148+ configTime (0 , 0 , " time.arduino.cc" , " pool.ntp.org" , " time.nist.gov" );
149+ #endif
150+ return NetworkConnectionState::CONNECTED;
148151 }
149152}
150153
@@ -167,14 +170,6 @@ NetworkConnectionState WiFiConnectionHandler::update_handleConnected()
167170 return NetworkConnectionState::CONNECTED;
168171}
169172
170- NetworkConnectionState WiFiConnectionHandler::update_handleGetTime ()
171- {
172- #ifdef BOARD_ESP8266
173- configTime (0 , 0 , " time.arduino.cc" , " pool.ntp.org" , " time.nist.gov" );
174- #endif
175- return NetworkConnectionState::CONNECTED;
176- }
177-
178173NetworkConnectionState WiFiConnectionHandler::update_handleDisconnecting ()
179174{
180175 WiFi.disconnect ();
0 commit comments