Improving mac OS part

This commit is contained in:
Christian Kuster 2023-01-24 21:35:10 +01:00
parent 0fe7bd8eed
commit 9d42fb9b5e
3 changed files with 9 additions and 9 deletions

View File

@ -47,7 +47,7 @@ The tool returns an array with objects, each object representing a network with
* channel: WiFi channel * channel: WiFi channel
* ssid: SSID of the network (if available) * ssid: SSID of the network (if available)
* mac: MAC Address of the network access point * mac: MAC Address of the network access point (if available, otherwise empty string)
* rssi: signal strength * rssi: signal strength
In contrary to other wifi scanners no information about security is returned. This is due to the very different implementation In contrary to other wifi scanners no information about security is returned. This is due to the very different implementation

View File

@ -20,11 +20,11 @@ function parseOutput(str, callback) {
let lines = str.split('\n'); let lines = str.split('\n');
for (let i = 1, l = lines.length; i < l; i++) { for (let i = 1, l = lines.length; i < l; i++) {
if (lines[i] == '') continue; if (lines[i] === '') continue;
let elements = lines[i].substr(51).split(/[ ]+/); let elements = lines[i].substring(51).split(/[ ]+/);
wifis.push({ wifis.push({
'ssid' : lines[i].substr(0,32).trim(), 'ssid' : lines[i].substring(0, 32).trim(),
'mac' : lines[i].substr(33,17).trim(), 'mac' : '', // There is no more mac on a mac
'channel': parseInt(elements[1].trim(), 10), 'channel': parseInt(elements[1].trim(), 10),
'rssi' : parseInt(elements[0].trim(), 10) 'rssi' : parseInt(elements[0].trim(), 10)
}); });

View File

@ -35,12 +35,12 @@
"test": "mocha test" "test": "mocha test"
}, },
"dependencies": { "dependencies": {
"async": "3.1.0", "async": "3.2.4",
"lodash": "4.17.15" "lodash": "4.17.21"
}, },
"devDependencies": { "devDependencies": {
"grunt": "^1.0.3", "grunt": "1.5.3",
"grunt-bump": "0.8.0", "grunt-bump": "0.8.0",
"mocha": "6.2.0" "mocha": "10.2.0"
} }
} }