Commit ff85f3e9 authored by A C SREEDHAR REDDY's avatar A C SREEDHAR REDDY Committed by Me No Dev

connect only to provided creds (#2491)

parent dffda0bd
/** /**
* *
* @file ESP8266WiFiMulti.cpp * @file WiFiMulti.cpp
* @date 16.05.2015 * @date 16.05.2015
* @author Markus Sattler * @author Markus Sattler
* *
...@@ -48,8 +48,15 @@ uint8_t WiFiMulti::run(uint32_t connectTimeout) ...@@ -48,8 +48,15 @@ uint8_t WiFiMulti::run(uint32_t connectTimeout)
int8_t scanResult; int8_t scanResult;
uint8_t status = WiFi.status(); uint8_t status = WiFi.status();
if(status == WL_CONNECTED) { if(status == WL_CONNECTED) {
for(uint32_t x = 0; x < APlist.size(); x++) {
if(WiFi.SSID()==APlist[x].ssid){
return status; return status;
} }
}
WiFi.disconnect(false,false);
delay(10);
status = WiFi.status();
}
scanResult = WiFi.scanNetworks(); scanResult = WiFi.scanNetworks();
if(scanResult == WIFI_SCAN_RUNNING) { if(scanResult == WIFI_SCAN_RUNNING) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment