esp8266 / esp8266/Arduino

ESP8266's WiFi.waitForConnectResult() doesn't have couter to try to connection ?

Open
#4,983 1 comment 0 reactions 0 assignees View on GitHub
waiting for feedback
Dominant language
C++
Stars
16.7k
Forks
13.1k
PR merge metrics
No merged PRs in 30d

Description

ESP32's WiFI.waitForConnectResult() has a counter to try 100 times.
Wish ESP8266 has the same behavior too.

Thank you.

```
// ESP32's WiFi.waitForConnectionResult()
uint8_t WiFiSTAClass::waitForConnectResult()
{
//1 and 3 have STA enabled
if((WiFiGenericClass::getMode() & WIFI_MODE_STA) == 0) {
return WL_DISCONNECTED;
}
int i = 0;
while((!status() || status() >= WL_DISCONNECTED) && i++ < 100) {
delay(100);
}
return status();
}
```

ESP8266 v2.4.1 core
```
uint8_t ESP8266WiFiSTAClass::waitForConnectResult() {
//1 and 3 have STA enabled
if((wifi_get_opmode() & 1) == 0) {
return WL_DISCONNECTED;
}
while(status() == WL_DISCONNECTED) {
delay(100);
}
return status();
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.