Unverified Commit 6e0d6a27 authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by GitHub

Avoid rescanning/connecting on WiFiMulti.run (#782)

If the WiFi network is already up, don't run the scan and connection
algorithm in WiFiMulti.
parent a2465f5f
......@@ -58,6 +58,12 @@ bool WiFiMulti::addAP(const char *ssid, const char *pass) {
}
uint8_t WiFiMulti::run(uint32_t to) {
// If we're already connected, don't re-scan/etc.
if (WiFi.status() == WL_CONNECTED) {
return WL_CONNECTED;
}
int cnt = WiFi.scanNetworks();
if (!cnt) {
return WL_DISCONNECTED;
......
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