@@ -79,7 +79,7 @@ NetworkConnectionState WiFiConnectionHandler::check()
79
79
case NetworkConnectionState::INIT: _netConnectionState = update_handleInit (); break ;
80
80
case NetworkConnectionState::CONNECTING: _netConnectionState = update_handleConnecting (); break ;
81
81
case NetworkConnectionState::CONNECTED: _netConnectionState = update_handleConnected (); break ;
82
- case NetworkConnectionState::GETTIME: _netConnectionState = update_handleGetTime (); break ;
82
+ case NetworkConnectionState::GETTIME: /* Unused */ break ;
83
83
case NetworkConnectionState::DISCONNECTING: _netConnectionState = update_handleDisconnecting (); break ;
84
84
case NetworkConnectionState::DISCONNECTED: _netConnectionState = update_handleDisconnected (); break ;
85
85
case NetworkConnectionState::ERROR: break ;
@@ -144,7 +144,10 @@ NetworkConnectionState WiFiConnectionHandler::update_handleConnecting()
144
144
{
145
145
Debug.print (DBG_INFO, " Connected to \" %s\" " , _ssid);
146
146
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;
148
151
}
149
152
}
150
153
@@ -167,14 +170,6 @@ NetworkConnectionState WiFiConnectionHandler::update_handleConnected()
167
170
return NetworkConnectionState::CONNECTED;
168
171
}
169
172
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
-
178
173
NetworkConnectionState WiFiConnectionHandler::update_handleDisconnecting ()
179
174
{
180
175
WiFi.disconnect ();
0 commit comments