We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e83b8b commit c22f644Copy full SHA for c22f644
libraries/WiFiS3/src/WiFi.cpp
@@ -329,9 +329,9 @@ IPAddress CWifi::localIP() {
329
/* -------------------------------------------------------------------------- */
330
modem.begin();
331
string res = "";
332
- int attempts = 0;
333
IPAddress local_IP(0,0,0,0);
334
+ unsigned long start_time = millis();
335
do {
336
delay(100);
337
if(modem.write(string(PROMPT(_MODE)),res, "%s" , CMD_READ(_MODE))) {
@@ -349,9 +349,8 @@ IPAddress CWifi::localIP() {
349
}
350
351
352
- attempts++;
353
354
- while(local_IP == IPAddress(0,0,0,0) && attempts < 50);
+ while((local_IP == IPAddress(0,0,0,0)) && (millis() - start_time < _timeout));
355
356
return local_IP;
357
0 commit comments