systeminformation
Advanced tools
Comparing version 5.23.15 to 5.23.16
@@ -348,3 +348,3 @@ 'use strict'; | ||
function parseWifiDarwin(wifiObj) { | ||
function parseWifiDarwinXX(wifiObj) { | ||
const result = []; | ||
@@ -401,3 +401,3 @@ if (wifiObj) { | ||
function parseWifi2Darwin(wifiStr) { | ||
function parseWifiDarwin(wifiStr) { | ||
const result = []; | ||
@@ -422,12 +422,13 @@ try { | ||
} | ||
const channelInfo = new RegExp(/(\d+) \((\d)GHz, (\d+)MHz\)/g).exec(wifiItem.spairport_network_channel); | ||
const channel = parseInt(('' + wifiItem.spairport_network_channel).split(' ')[0]) || 0; | ||
const signalLevel = wifiItem.spairport_signal_noise || null; | ||
result.push({ | ||
ssid: wifiItem._name || '', | ||
bssid: '', | ||
bssid: wifiItem.spairport_network_bssid || null, | ||
mode: wifiItem.spairport_network_phymode, | ||
channel: parseInt(channelInfo[0].split(' ')[0]), | ||
frequency: wifiFrequencyFromChannel(channelInfo[1]), | ||
signalLevel: null, | ||
quality: null, | ||
channel, | ||
frequency: wifiFrequencyFromChannel(channel), | ||
signalLevel: signalLevel ? parseInt(signalLevel, 10) : null, | ||
quality: wifiQualityFromDB(signalLevel), | ||
security, | ||
@@ -506,11 +507,5 @@ wpaFlags: [], | ||
} else if (_darwin) { | ||
let cmd = '/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s -x >2 /dev/bull; echo "######"; system_profiler -json SPAirPortDataType'; | ||
let cmd = 'system_profiler SPAirPortDataType -json 2>/dev/null'; | ||
exec(cmd, { maxBuffer: 1024 * 40000 }, function (error, stdout) { | ||
const output = stdout.toString(); | ||
const parts = output.split('######'); | ||
if (parts[0]) { | ||
result = parseWifiDarwin(util.plistParser(parts[0])); | ||
} else { | ||
result = parseWifi2Darwin(parts[1]); | ||
} | ||
result = parseWifiDarwin(stdout.toString()); | ||
if (callback) { | ||
@@ -517,0 +512,0 @@ callback(result); |
{ | ||
"name": "systeminformation", | ||
"version": "5.23.15", | ||
"version": "5.23.16", | ||
"description": "Advanced, lightweight system and OS information library", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
774449
17081