Commit d0cdc165 authored by lyong's avatar lyong

fix:自动化测试更新功能返回信号最好的wifi

parent 88b34e27
......@@ -127,13 +127,21 @@ function getWifiScan(value) {
console.log("value:" + value)
var ssid = AnalyzeATSearchSsid(value);
console.log("check ssid :" + ssid + "------")
var found = resultsWifiList.find(ap => ap.name == ssid);
if (found) {
return `name:${found.name},rssi:${found.rssi},mac:${found.mac}`;
}
else {
// var found = resultsWifiList.find(ap => ap.name == ssid);
// if (found) {
// return `name:${found.name},rssi:${found.rssi},mac:${found.mac}`;
// }
// else {
// return "FAIL";
// }
var matchingAPs = resultsWifiList.filter(ap => ap.name === ssid);
if (matchingAPs.length === 0) {
return "FAIL";
}
console.log("matchingAPs :" + JSON.stringify(matchingAPs) + "------")
var bestAP = matchingAPs.sort((a, b) => b.rssi - a.rssi)[0];
return `name:${bestAP.name},rssi:${bestAP.rssi},mac:${bestAP.mac}`;
}
function writeSn(sn) {
userData.aboutSNValue = sn;
......
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