systeminformation 5.21.25 → 5.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -128,6 +128,7 @@ si.cpu()
128
128
 
129
129
  (last 7 major and minor version releases)
130
130
 
131
+ - Version 5.22.0: `wifiConnections()` added signal quality
131
132
  - Version 5.21.0: `graphics()` added subVendor (linux)
132
133
  - Version 5.20.0: `mem()` added writeback and dirty (linux)
133
134
  - Version 5.19.0: `currentLoad()` added steal and guest time (linux)
@@ -658,15 +659,15 @@ Full function reference with examples can be found at [https://systeminformation
658
659
  | si.wifiConnections(cb) | [{...}] | X | | X | X | | array of active wifi connections |
659
660
  | | [0].id | X | | X | X | | ID |
660
661
  | | [0].iface | X | | X | X | | interface |
661
- | | [0].name | X | | X | X | | name |
662
- | | [0].mode | X | | X | X | | model |
662
+ | | [0].model | X | | X | X | | model |
663
+ | | [0].ssid | X | | X | X | | SSID |
663
664
  | | [0].bssid | X | | (X) | X | | BSSID (mac) - macOS only on older os versions |
664
- | | [0].mode | X | | | | | mode |
665
665
  | | [0].channel | X | | X | X | | channel |
666
666
  | | [0].frequency | X | | X | X | | frequency in MHz |
667
+ | | [0].type | X | | X | X | | e.g. 802.11 |
668
+ | | [0].security | X | | X | X | | array e.g. WPA, WPA-2 |
667
669
  | | [0].signalLevel | X | | X | X | | signal level in dB |
668
670
  | | [0].quality | X | | X | X | | quality in % |
669
- | | [0].security | X | | X | X | | array e.g. WPA, WPA-2 |
670
671
  | | [0].txRate | X | | X | X | | transfer rate MBit/s |
671
672
 
672
673
  #### 15. Bluetooth
package/lib/index.d.ts CHANGED
@@ -576,10 +576,11 @@ export namespace Systeminformation {
576
576
  ssid: string;
577
577
  bssid: string;
578
578
  channel: number;
579
+ frequency: number;
579
580
  type: string;
580
581
  security: string;
581
- frequency: number;
582
582
  signalLevel: number;
583
+ quality: number;
583
584
  txRate: number;
584
585
  }
585
586
 
package/lib/wifi.js CHANGED
@@ -247,14 +247,15 @@ function getWifiNetworkListNmi() {
247
247
  const security = util.getValue(lines, 'SECURITY').replace('(', '').replace(')', '');
248
248
  const wpaFlags = util.getValue(lines, 'WPA-FLAGS').replace('(', '').replace(')', '');
249
249
  const rsnFlags = util.getValue(lines, 'RSN-FLAGS').replace('(', '').replace(')', '');
250
+ const quality = util.getValue(lines, 'SIGNAL');
250
251
  result.push({
251
252
  ssid: util.getValue(lines, 'SSID'),
252
253
  bssid: util.getValue(lines, 'BSSID').toLowerCase(),
253
254
  mode: util.getValue(lines, 'MODE'),
254
255
  channel: channel ? parseInt(channel, 10) : null,
255
256
  frequency: frequency ? parseInt(frequency, 10) : null,
256
- signalLevel: wifiDBFromQuality(util.getValue(lines, 'SIGNAL')),
257
- quality: parseFloat(util.getValue(lines, 'SIGNAL')),
257
+ signalLevel: wifiDBFromQuality(quality),
258
+ quality: quality ? parseInt(quality, 10) : null,
258
259
  security: security && security !== 'none' ? security.split(' ') : [],
259
260
  wpaFlags: wpaFlags && wpaFlags !== 'none' ? wpaFlags.split(' ') : [],
260
261
  rsnFlags: rsnFlags && rsnFlags !== 'none' ? rsnFlags.split(' ') : []
@@ -575,6 +576,7 @@ function wifiConnections(callback) {
575
576
  const nmiConnection = nmiConnectionLinux(ssidSanitized);
576
577
  const channel = network && network.length && network[0].channel ? network[0].channel : (wpaDetails.channel ? wpaDetails.channel : null);
577
578
  const bssid = network && network.length && network[0].bssid ? network[0].bssid : (wpaDetails.bssid ? wpaDetails.bssid : null);
579
+ const signalLevel = network && network.length && network[0].signalLevel ? network[0].signalLevel : null;
578
580
  if (ssid && bssid) {
579
581
  result.push({
580
582
  id: ifaceDetail.id,
@@ -586,7 +588,8 @@ function wifiConnections(callback) {
586
588
  frequency: channel ? wifiFrequencyFromChannel(channel) : null,
587
589
  type: nmiConnection.type ? nmiConnection.type : '802.11',
588
590
  security: nmiConnection.security ? nmiConnection.security : (wpaDetails.security ? wpaDetails.security : null),
589
- signalLevel: network && network.length && network[0].signalLevel ? network[0].signalLevel : null,
591
+ signalLevel,
592
+ quality: wifiQualityFromDB(signalLevel),
590
593
  txRate: null
591
594
  });
592
595
  }
@@ -614,8 +617,8 @@ function wifiConnections(callback) {
614
617
  const channel = util.getValue(lines2, 'channel', ':', true).split(',')[0];
615
618
  const type = '802.11';
616
619
  const rssi = util.toInt(util.getValue(lines2, 'agrCtlRSSI', ':', true));
617
- const noise = util.toInt(util.getValue(lines2, 'agrCtlNoise', ':', true));
618
- const signalLevel = rssi - noise;
620
+ /// const noise = util.toInt(util.getValue(lines2, 'agrCtlNoise', ':', true));
621
+ const signalLevel = rssi;
619
622
  if (ssid || bssid) {
620
623
  result.push({
621
624
  id: 'Wi-Fi',
@@ -628,6 +631,7 @@ function wifiConnections(callback) {
628
631
  type,
629
632
  security,
630
633
  signalLevel,
634
+ quality: wifiQualityFromDB(signalLevel),
631
635
  txRate
632
636
  });
633
637
  }
@@ -661,7 +665,8 @@ function wifiConnections(callback) {
661
665
  const id = lines[2].indexOf(':') >= 0 ? lines[2].split(':')[1].trim() : '';
662
666
  const ssid = util.getValue(lines, 'SSID', ':', true);
663
667
  const bssid = util.getValue(lines, 'BSSID', ':', true);
664
- const signalLevel = wifiDBFromQuality(util.getValue(lines, 'Signal', ':', true));
668
+ const quality = util.getValue(lines, 'Signal', ':', true);
669
+ const signalLevel = wifiDBFromQuality(quality);
665
670
  const type = util.getValue(lines, 'Radio type', ':', true) || util.getValue(lines, 'Type de radio', ':', true) || util.getValue(lines, 'Funktyp', ':', true) || null;
666
671
  const security = util.getValue(lines, 'authentication', ':', true) || util.getValue(lines, 'Authentification', ':', true) || util.getValue(lines, 'Authentifizierung', ':', true) || null;
667
672
  const channel = util.getValue(lines, 'Channel', ':', true) || util.getValue(lines, 'Canal', ':', true) || util.getValue(lines, 'Kanal', ':', true) || null;
@@ -678,6 +683,7 @@ function wifiConnections(callback) {
678
683
  type,
679
684
  security,
680
685
  signalLevel,
686
+ quality: quality ? parseInt(quality, 10) : null,
681
687
  txRate: util.toInt(txRate) || null
682
688
  });
683
689
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.21.25",
3
+ "version": "5.22.0",
4
4
  "description": "Advanced, lightweight system and OS information library",
5
5
  "license": "MIT",
6
6
  "author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",