Skip to content

Commit 9dae9ce

Browse files
copercinime-no-dev
authored andcommitted
Fix for WiFiMulti (#264)
Actually WiFiMulti is not working due some functions haven't equal comportment of ESP8266 Replace status == WL_DISCONNECTED => status != WL_CONNECTED Replace scanComplete() => scanNetworks() Maybe is more interesting, for keep the maximum compatibility, investigate why WL_DISCONNECTED and scanComplete() doesn't works in this case instead of just replace by this pull request.
1 parent 7864255 commit 9dae9ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: libraries/WiFi/src/WiFiMulti.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ uint8_t WiFiMulti::run(void)
4747

4848
int8_t scanResult;
4949
uint8_t status = WiFi.status();
50-
if(status == WL_DISCONNECTED || status == WL_NO_SSID_AVAIL || status == WL_IDLE_STATUS || status == WL_CONNECT_FAILED) {
50+
if(status != WL_CONNECTED || status == WL_NO_SSID_AVAIL || status == WL_IDLE_STATUS || status == WL_CONNECT_FAILED) {
5151

52-
scanResult = WiFi.scanComplete();
52+
scanResult = WiFi.scanNetworks();
5353
if(scanResult == WIFI_SCAN_RUNNING) {
5454
// scan is running
5555
return WL_NO_SSID_AVAIL;

0 commit comments

Comments
 (0)