Removed security field, detection is not error proof for all tools.
This commit is contained in:
@ -30,8 +30,7 @@ function parseOutput(str, callback) {
|
||||
'ssid' : lines[i].substr(0, macStart).trim(),
|
||||
'mac' : elements[0].trim(),
|
||||
'channel' : parseInt(elements[2].trim(), 10),
|
||||
'rssi' : parseInt(elements[1].trim()),
|
||||
'security': elements[3].trim()
|
||||
'rssi' : parseInt(elements[1].trim())
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -32,11 +32,10 @@ function parseOutput(str, callback) {
|
||||
// SSID
|
||||
if (line.indexOf('ESSID:') > 0) {
|
||||
network.ssid = _.trim(line.split(':')[1], '"');
|
||||
}
|
||||
|
||||
// Security
|
||||
else if (_.startsWith(line.trim(), 'IE:')) {
|
||||
network.security = line.split(':')[1].trim();
|
||||
if (_.startsWith(network.ssid, '\\x00')) {
|
||||
// The raspi 3 interprets a string terminator as character, it's an empty SSID
|
||||
network.ssid = '';
|
||||
}
|
||||
}
|
||||
|
||||
// Channel, an ugly thing to get it
|
||||
|
@ -61,12 +61,12 @@ function parseOutput(str, callback) {
|
||||
// Network signal strength, identified by '%'
|
||||
var level = parseInt(lines[t].split(':')[1].split('%')[0].trim(), 10);
|
||||
|
||||
network.signal_level = (level / 2) - 100;
|
||||
network.rssi = (level / 2) - 100;
|
||||
}
|
||||
else if (!network.channel) {
|
||||
// A tricky one: the channel is the first one having just ONE number. Set only
|
||||
// if the channel is not already set ("Basic Rates" can be a single number also)
|
||||
if (regexChannel.exec(lines[t])) {
|
||||
if (regexChannel.exec(lines[t].trim())) {
|
||||
network.channel = parseInt(lines[t].split(':')[1].trim());
|
||||
}
|
||||
}
|
||||
|
@ -31,8 +31,7 @@ function parseOutput(str, callback) {
|
||||
'ssid' : _.trim(lines[i].substr(0, macStart), ' \''),
|
||||
'mac' : elements[0].trim(),
|
||||
'channel' : parseInt(elements[2].trim(), 10),
|
||||
'rssi' : parseInt(elements[1].trim()),
|
||||
'security': 'TODO'
|
||||
'rssi' : parseInt(elements[1].trim())
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user