File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 9
9
#include < string>
10
10
#include < sstream>
11
11
#include < iomanip>
12
+ #include < algorithm>
12
13
#include " sdkconfig.h"
13
14
14
15
@@ -379,11 +380,15 @@ std::vector<WiFiAPRecord> WiFi::scan() {
379
380
for (auto i=0 ; i<apCount; i++) {
380
381
WiFiAPRecord wifiAPRecord;
381
382
memcpy (wifiAPRecord.m_bssid , list[i].bssid , 6 );
382
- wifiAPRecord.m_ssid = std::string ((char *)list[i].ssid );
383
+ wifiAPRecord.m_ssid = std::string ((char *)list[i].ssid );
383
384
wifiAPRecord.m_authMode = list[i].authmode ;
385
+ wifiAPRecord.m_rssi = list[i].rssi ;
384
386
apRecords.push_back (wifiAPRecord);
385
387
}
386
388
free (list); // Release the storage allocated to hold the records.
389
+ std::sort (apRecords.begin (),
390
+ apRecords.end (),
391
+ [](const WiFiAPRecord& lhs,const WiFiAPRecord& rhs){ return lhs.m_rssi > rhs.m_rssi ;});
387
392
return apRecords;
388
393
} // scan
389
394
You can’t perform that action at this time.
0 commit comments