wifiNetworks() fix empty issue (mac OS)
This commit is contained in:
parent
c7fbf26b9a
commit
0e62049339
@ -80,6 +80,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
|
|||||||
|
|
||||||
| Version | Date | Comment |
|
| Version | Date | Comment |
|
||||||
| -------------- | -------------- | -------- |
|
| -------------- | -------------- | -------- |
|
||||||
|
| 5.9.17 | 2021-12-07 | `wifiNetworks()` fix empty issue (mac OS) |
|
||||||
| 5.9.16 | 2021-12-05 | `wifiNetworks()` adaption for Apple silicon (mac OS) |
|
| 5.9.16 | 2021-12-05 | `wifiNetworks()` adaption for Apple silicon (mac OS) |
|
||||||
| 5.9.15 | 2021-11-19 | `cpuCache()` fix (windows) |
|
| 5.9.15 | 2021-11-19 | `cpuCache()` fix (windows) |
|
||||||
| 5.9.14 | 2021-11-17 | `versions()` python 2 monterey (deprecated warning) fix (mac OS) |
|
| 5.9.14 | 2021-11-17 | `versions()` python 2 monterey (deprecated warning) fix (mac OS) |
|
||||||
|
|||||||
@ -57,6 +57,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">5.9.17</th>
|
||||||
|
<td>2021-12-07</td>
|
||||||
|
<td><span class="code">wifiNetworks()</span> fix empty issue (mac OS)</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">5.9.16</th>
|
<th scope="row">5.9.16</th>
|
||||||
<td>2021-12-05</td>
|
<td>2021-12-05</td>
|
||||||
|
|||||||
@ -170,7 +170,7 @@
|
|||||||
<img class="logo" src="assets/logo.png">
|
<img class="logo" src="assets/logo.png">
|
||||||
<div class="title">systeminformation</div>
|
<div class="title">systeminformation</div>
|
||||||
<div class="subtitle"><span id="typed"></span> </div>
|
<div class="subtitle"><span id="typed"></span> </div>
|
||||||
<div class="version">New Version: <span id="version">5.9.16</span></div>
|
<div class="version">New Version: <span id="version">5.9.17</span></div>
|
||||||
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
|
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="down">
|
<div class="down">
|
||||||
|
|||||||
74
lib/wifi.js
74
lib/wifi.js
@ -341,46 +341,48 @@ function getWifiNetworkListIw(iface) {
|
|||||||
*/
|
*/
|
||||||
function parseWifiDarwin(wifiObj) {
|
function parseWifiDarwin(wifiObj) {
|
||||||
const result = [];
|
const result = [];
|
||||||
wifiObj.forEach(function (wifiItem) {
|
if (wifiObj) {
|
||||||
const signalLevel = wifiItem.RSSI;
|
wifiObj.forEach(function (wifiItem) {
|
||||||
let security = [];
|
const signalLevel = wifiItem.RSSI;
|
||||||
let wpaFlags = [];
|
let security = [];
|
||||||
if (wifiItem.WPA_IE) {
|
let wpaFlags = [];
|
||||||
security.push('WPA');
|
if (wifiItem.WPA_IE) {
|
||||||
if (wifiItem.WPA_IE.IE_KEY_WPA_UCIPHERS) {
|
security.push('WPA');
|
||||||
wifiItem.WPA_IE.IE_KEY_WPA_UCIPHERS.forEach(function (ciphers) {
|
if (wifiItem.WPA_IE.IE_KEY_WPA_UCIPHERS) {
|
||||||
if (ciphers === 0 && wpaFlags.indexOf('unknown/TKIP') === -1) { wpaFlags.push('unknown/TKIP'); }
|
wifiItem.WPA_IE.IE_KEY_WPA_UCIPHERS.forEach(function (ciphers) {
|
||||||
if (ciphers === 2 && wpaFlags.indexOf('PSK/TKIP') === -1) { wpaFlags.push('PSK/TKIP'); }
|
if (ciphers === 0 && wpaFlags.indexOf('unknown/TKIP') === -1) { wpaFlags.push('unknown/TKIP'); }
|
||||||
if (ciphers === 4 && wpaFlags.indexOf('PSK/AES') === -1) { wpaFlags.push('PSK/AES'); }
|
if (ciphers === 2 && wpaFlags.indexOf('PSK/TKIP') === -1) { wpaFlags.push('PSK/TKIP'); }
|
||||||
});
|
if (ciphers === 4 && wpaFlags.indexOf('PSK/AES') === -1) { wpaFlags.push('PSK/AES'); }
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
if (wifiItem.RSN_IE) {
|
||||||
if (wifiItem.RSN_IE) {
|
security.push('WPA2');
|
||||||
security.push('WPA2');
|
if (wifiItem.RSN_IE.IE_KEY_RSN_UCIPHERS) {
|
||||||
if (wifiItem.RSN_IE.IE_KEY_RSN_UCIPHERS) {
|
wifiItem.RSN_IE.IE_KEY_RSN_UCIPHERS.forEach(function (ciphers) {
|
||||||
wifiItem.RSN_IE.IE_KEY_RSN_UCIPHERS.forEach(function (ciphers) {
|
if (ciphers === 0 && wpaFlags.indexOf('unknown/TKIP') === -1) { wpaFlags.push('unknown/TKIP'); }
|
||||||
if (ciphers === 0 && wpaFlags.indexOf('unknown/TKIP') === -1) { wpaFlags.push('unknown/TKIP'); }
|
if (ciphers === 2 && wpaFlags.indexOf('TKIP/TKIP') === -1) { wpaFlags.push('TKIP/TKIP'); }
|
||||||
if (ciphers === 2 && wpaFlags.indexOf('TKIP/TKIP') === -1) { wpaFlags.push('TKIP/TKIP'); }
|
if (ciphers === 4 && wpaFlags.indexOf('PSK/AES') === -1) { wpaFlags.push('PSK/AES'); }
|
||||||
if (ciphers === 4 && wpaFlags.indexOf('PSK/AES') === -1) { wpaFlags.push('PSK/AES'); }
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
result.push({
|
||||||
result.push({
|
ssid: wifiItem.SSID_STR,
|
||||||
ssid: wifiItem.SSID_STR,
|
bssid: wifiItem.BSSID,
|
||||||
bssid: wifiItem.BSSID,
|
mode: '',
|
||||||
mode: '',
|
channel: wifiItem.CHANNEL,
|
||||||
channel: wifiItem.CHANNEL,
|
frequency: wifiFrequencyFromChannel(wifiItem.CHANNEL),
|
||||||
frequency: wifiFrequencyFromChannel(wifiItem.CHANNEL),
|
signalLevel: signalLevel ? parseInt(signalLevel, 10) : null,
|
||||||
signalLevel: signalLevel ? parseInt(signalLevel, 10) : null,
|
quality: wifiQualityFromDB(signalLevel),
|
||||||
quality: wifiQualityFromDB(signalLevel),
|
security,
|
||||||
security,
|
wpaFlags,
|
||||||
wpaFlags,
|
rsnFlags: []
|
||||||
rsnFlags: []
|
|
||||||
|
});
|
||||||
|
wifiItem.BSSID;
|
||||||
|
|
||||||
});
|
});
|
||||||
wifiItem.BSSID;
|
}
|
||||||
|
|
||||||
});
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
function wifiNetworks(callback) {
|
function wifiNetworks(callback) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user