wifiInterfaces(), wifiConnections() added

This commit is contained in:
Sebastian Hildebrandt
2021-02-10 16:08:55 +01:00
parent cce9fd5f73
commit ac29803f03
18 changed files with 904 additions and 97 deletions
+272 -1
View File
@@ -47,7 +47,7 @@
<div class="col-12 sectionheader">
<div class="title">Wifi</div>
<div class="text">
<p>In this section you will learn how to get detailed information about available wifi networks:</p>
<p>In this section you will learn how to get detailed information about available wifi networks, interfaces and connections:</p>
<p>For function reference and examples we assume, that we imported <span class="code">systeminformation</span> as follows:</p>
<pre><code class="js">const si = require('systeminformation');</code></pre>
<h2>Wifi Networks</h2>
@@ -214,6 +214,277 @@ si.wifiNetworks().then(data => console.log(data));</code></pre class="example">
</tbody>
</table>
<h2>Wifi Interfaces</h2>
<p>All functions in this section return a promise or can be called with a callback function (parameter <span class="code">cb</span> in the function reference)</p>
<table class="table table-sm table-bordered table-striped">
<thead>
<tr>
<th>Function</th>
<th>Result object</th>
<th>Linux</th>
<th>BSD</th>
<th>Mac</th>
<th>Win</th>
<th>Sun</th>
<th>Comments</th>
</tr>
</thead>
<tbody>
<tr>
<td>si.wifiInterfaces(cb)</td>
<td>[{...}]</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td>array of detected wifi interfaces</td>
</tr>
<tr>
<td></td>
<td>[0].id</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td>Wifi ID</td>
</tr>
<tr>
<td></td>
<td>[0].iface</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td>interface</td>
</tr>
<tr>
<td></td>
<td>[0].model</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td>model</td>
</tr>
<tr>
<td></td>
<td>[0].vendor</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td>vendor</td>
</tr>
<tr>
<td></td>
<td>[0].mac</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td>interface MAC</td>
</tr>
<tr class="example">
<td></td>
<td colspan="7">
<h5>Example</h5>
<pre><code class="js">const si = require('systeminformation');
si.wifiInterfaces().then(data => console.log(data));</code></pre class="example">
<pre class="example">
[
{
id: 'Wi-Fi',
iface: 'en0',
model: 'AirPort',
vendor: '',
mac: 'a0:b1:c2:d3:e4:f5'
},
...
]</pre>
</tr>
</tbody>
</table>
<h2>Wifi Connections</h2>
<p>All functions in this section return a promise or can be called with a callback function (parameter <span class="code">cb</span> in the function reference)</p>
<table class="table table-sm table-bordered table-striped">
<thead>
<tr>
<th>Function</th>
<th>Result object</th>
<th>Linux</th>
<th>BSD</th>
<th>Mac</th>
<th>Win</th>
<th>Sun</th>
<th>Comments</th>
</tr>
</thead>
<tbody>
<tr>
<td>si.wifiConnections(cb)</td>
<td>[{...}]</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td>array of active wifi connections</td>
</tr>
<tr>
<td></td>
<td>[0].id</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td>Wifi ID</td>
</tr>
<tr>
<td></td>
<td>[0].iface</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td>interface</td>
</tr>
<tr>
<td></td>
<td>[0].name</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td>name</td>
</tr>
<tr>
<td></td>
<td>[0].model</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td>model</td>
</tr>
<tr>
<td></td>
<td>[0].ssid</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td>Wifi network SSID</td>
</tr>
<tr>
<td></td>
<td>[0].bssid</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td>BSSID (mac)</td>
</tr>
<tr>
<td></td>
<td>[0].channel</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td>channel</td>
</tr>
<tr>
<td></td>
<td>[0].frequency</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td>frequency</td>
</tr>
<tr>
<td></td>
<td>[0].type</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td>WiFi type</td>
</tr>
<tr>
<td></td>
<td>[0].security</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td>WiFi security</td>
</tr>
<tr>
<td></td>
<td>[0].signalLevel</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td>signal level in dB</td>
</tr>
<tr>
<td></td>
<td>[0].txRate</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td>transfer rate Mbit/s</td>
</tr>
<tr class="example">
<td></td>
<td colspan="7">
<h5>Example</h5>
<pre><code class="js">const si = require('systeminformation');
si.wifiConnections().then(data => console.log(data));</code></pre class="example">
<pre class="example">
[
{
id: 'Wi-Fi',
iface: 'en0',
name: 'AirPort',
model: 'AirPort',
ssid: 'my-own-internet',
bssid: '01:23:45:67:89:0a',
channel: 36,
frequency: 5180,
type: '802.11',
security: 'wpa2-psk',
signalLevel: 46,
txRate: '405'
},
...
]</pre>
</tr>
</tbody>
</table>
</div>
</div>