Skip to content

Commit a0ef198

Browse files
committed
Don't fail begin if not connected in 5 seconds
1 parent 793c0a4 commit a0ef198

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/WiFi.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ int WiFiClass::begin(const char* ssid)
5353
delay(WL_DELAY_START_CONNECTION);
5454
status = WiFiDrv::getConnectionStatus();
5555
}
56-
while ((( status == WL_IDLE_STATUS)||(status == WL_SCAN_COMPLETED))&&(--attempts>0));
56+
while (((status == WL_IDLE_STATUS)||(status == WL_NO_SSID_AVAIL)||(status == WL_SCAN_COMPLETED))&&(--attempts>0));
5757
}else
5858
{
5959
status = WL_CONNECT_FAILED;
@@ -73,7 +73,7 @@ int WiFiClass::begin(const char* ssid, uint8_t key_idx, const char *key)
7373
{
7474
delay(WL_DELAY_START_CONNECTION);
7575
status = WiFiDrv::getConnectionStatus();
76-
}while ((( status == WL_IDLE_STATUS)||(status == WL_SCAN_COMPLETED))&&(--attempts>0));
76+
}while ((( status == WL_IDLE_STATUS)||(status == WL_NO_SSID_AVAIL)||(status == WL_SCAN_COMPLETED))&&(--attempts>0));
7777
}else{
7878
status = WL_CONNECT_FAILED;
7979
}
@@ -93,7 +93,7 @@ int WiFiClass::begin(const char* ssid, const char *passphrase)
9393
delay(WL_DELAY_START_CONNECTION);
9494
status = WiFiDrv::getConnectionStatus();
9595
}
96-
while ((( status == WL_IDLE_STATUS)||(status == WL_SCAN_COMPLETED))&&(--attempts>0));
96+
while ((( status == WL_IDLE_STATUS)||(status == WL_NO_SSID_AVAIL)||(status == WL_SCAN_COMPLETED))&&(--attempts>0));
9797
}else{
9898
status = WL_CONNECT_FAILED;
9999
}

0 commit comments

Comments
 (0)