Skip to content

Commit ff85f3e

Browse files
a-c-sreedhar-reddyme-no-dev
authored andcommitted
connect only to provided creds (espressif#2491)
1 parent dffda0b commit ff85f3e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

libraries/WiFi/src/WiFiMulti.cpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* @file ESP8266WiFiMulti.cpp
3+
* @file WiFiMulti.cpp
44
* @date 16.05.2015
55
* @author Markus Sattler
66
*
@@ -48,7 +48,14 @@ uint8_t WiFiMulti::run(uint32_t connectTimeout)
4848
int8_t scanResult;
4949
uint8_t status = WiFi.status();
5050
if(status == WL_CONNECTED) {
51-
return status;
51+
for(uint32_t x = 0; x < APlist.size(); x++) {
52+
if(WiFi.SSID()==APlist[x].ssid){
53+
return status;
54+
}
55+
}
56+
WiFi.disconnect(false,false);
57+
delay(10);
58+
status = WiFi.status();
5259
}
5360

5461
scanResult = WiFi.scanNetworks();

0 commit comments

Comments
 (0)