This commit is contained in:
Alex Tudorache
2016-03-02 16:39:03 +02:00
parent 3660ccdda5
commit 6f727ff2df
2 changed files with 15 additions and 1 deletions
+12 -1
View File
@@ -354,7 +354,7 @@ void WiFiManager::handleWifi(boolean scan) {
page += F("No networks found. Refresh to scan again.");
} else {
//sort networks
int indices[n];
/*int indices[n];
for (int i = 0; i < n; i++) {
indices[i] = i;
@@ -370,7 +370,18 @@ void WiFiManager::handleWifi(boolean scan) {
}
}
}
*/
int indices[n];
for (int i = 0; i < n; i++) {
indices[i] = i;
}
std::sort(indices, indices+n, [](const int & a, const int & b) -> bool
{
return WiFi.RSSI(a) > WiFi.RSSI(b);
});
//display networks in page
for (int i = 0; i < n; i++) {
DEBUG_WM(WiFi.SSID(indices[i]));