File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -362,14 +362,14 @@ bool WiFiSTAClass::getAutoReconnect()
362
362
* returns the status reached or disconnect if STA is off
363
363
* @return wl_status_t
364
364
*/
365
- uint8_t WiFiSTAClass::waitForConnectResult ()
365
+ uint8_t WiFiSTAClass::waitForConnectResult (unsigned long timeoutLength )
366
366
{
367
367
// 1 and 3 have STA enabled
368
368
if ((WiFiGenericClass::getMode () & WIFI_MODE_STA) == 0 ) {
369
369
return WL_DISCONNECTED;
370
370
}
371
- int i = 0 ;
372
- while ((!status () || status () >= WL_DISCONNECTED) && i++ < 100 ) {
371
+ unsigned long start = millis () ;
372
+ while ((!status () || status () >= WL_DISCONNECTED) && ( millis () - start) < timeoutLength ) {
373
373
delay (100 );
374
374
}
375
375
return status ();
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ class WiFiSTAClass
56
56
bool setAutoReconnect (bool autoReconnect);
57
57
bool getAutoReconnect ();
58
58
59
- uint8_t waitForConnectResult ();
59
+ uint8_t waitForConnectResult (unsigned long timeoutLength = 60000 );
60
60
61
61
// STA network info
62
62
IPAddress localIP ();
You can’t perform that action at this time.
0 commit comments