5 <title>JSDoc: Class: WifiDevice</title>
7 <script src="scripts/prettify/prettify.js"> </script>
8 <script src="scripts/prettify/lang-css.js"> </script>
10 <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
12 <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13 <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
20 <h1 class="page-title">Class: WifiDevice</h1>
31 <h2><span class="attribs"><span class="type-signature"></span></span>
32 <span class="ancestors"><a href="LuCI.html">LuCI</a><a href="LuCI.Network.html">.Network</a>.</span>WifiDevice</h2>
34 <div class="class-description"><p>A <code>Network.WifiDevice</code> class instance represents a wireless radio device
35 present on the system and provides wireless capability information as
36 well as methods for enumerating related wireless networks.</p></div>
42 <div class="container-overview">
87 <dt class="tag-source">Source:</dt>
88 <dd class="tag-source"><ul class="dummy"><li>
89 <a href="network.js.html">network.js</a>, <a href="network.js.html#line2957">line 2957</a>
137 <h3 class="subsection-title">Methods</h3>
145 <h4 class="name" id="addWifiNetwork"><span class="type-signature"></span>addWifiNetwork<span class="signature">(options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Promise.<(null|<a href="LuCI.Network.WifiNetwork.html">LuCI.Network.WifiNetwork</a>)>}</span></h4>
152 <div class="description">
153 <p>Adds a new wireless network associated with this radio device to the
154 configuration and sets its options to the provided values.</p>
168 <table class="params">
183 <th class="last">Description</th>
192 <td class="name"><code>options</code></td>
198 <span class="param-type">Object.<string, (string|Array.<string>)></span>
205 <td class="attributes">
218 <td class="description last"><p>The options to set for the newly added wireless network.</p></td>
257 <dt class="tag-source">Source:</dt>
258 <dd class="tag-source"><ul class="dummy"><li>
259 <a href="network.js.html">network.js</a>, <a href="network.js.html#line3222">line 3222</a>
287 <div class="param-desc">
288 <p>Returns a promise resolving to a <code>WifiNetwork</code> instance describing
289 the newly added wireless network or <code>null</code> if the given options
301 <span class="param-type">Promise.<(null|<a href="LuCI.Network.WifiNetwork.html">LuCI.Network.WifiNetwork</a>)></span>
319 <h4 class="name" id="deleteWifiNetwork"><span class="type-signature"></span>deleteWifiNetwork<span class="signature">(network)</span><span class="type-signature"> → {Promise.<boolean>}</span></h4>
326 <div class="description">
327 <p>Deletes the wireless network with the given name associated with this
342 <table class="params">
355 <th class="last">Description</th>
364 <td class="name"><code>network</code></td>
370 <span class="param-type">string</span>
380 <td class="description last"><p>The name of the wireless network to lookup. This may be either an uci
381 configuration section ID, a network ID in the form <code>radio#.network#</code>
382 or a Linux network device name like <code>wlan0</code> which is resolved to the
383 corresponding configuration section through <code>ubus</code> runtime information.</p></td>
422 <dt class="tag-source">Source:</dt>
423 <dd class="tag-source"><ul class="dummy"><li>
424 <a href="network.js.html">network.js</a>, <a href="network.js.html#line3247">line 3247</a>
452 <div class="param-desc">
453 <p>Returns a promise resolving to <code>true</code> when the wireless network was
454 successfully deleted from the configuration or <code>false</code> when the given
455 network could not be found or if the found network was not associated
456 with this wireless radio device.</p>
467 <span class="param-type">Promise.<boolean></span>
485 <h4 class="name" id="get"><span class="type-signature"></span>get<span class="signature">(opt)</span><span class="type-signature"> → {null|string|Array.<string>}</span></h4>
492 <div class="description">
493 <p>Read the given UCI option value of this wireless device.</p>
507 <table class="params">
520 <th class="last">Description</th>
529 <td class="name"><code>opt</code></td>
535 <span class="param-type">string</span>
545 <td class="description last"><p>The UCI option name to read.</p></td>
584 <dt class="tag-source">Source:</dt>
585 <dd class="tag-source"><ul class="dummy"><li>
586 <a href="network.js.html">network.js</a>, <a href="network.js.html#line2997">line 2997</a>
614 <div class="param-desc">
615 <p>Returns the UCI option value or <code>null</code> if the requested option is
627 <span class="param-type">null</span>
630 <span class="param-type">string</span>
633 <span class="param-type">Array.<string></span>
651 <h4 class="name" id="getHTModes"><span class="type-signature"></span>getHTModes<span class="signature">()</span><span class="type-signature"> → {Array.<string>}</span></h4>
658 <div class="description">
659 <p>Gets a list of supported htmodes.</p>
660 <p>The htmode values describe the wide-frequency options supported by
661 the wireless phy.</p>
703 <dt class="tag-source">Source:</dt>
704 <dd class="tag-source"><ul class="dummy"><li>
705 <a href="network.js.html">network.js</a>, <a href="network.js.html#line3075">line 3075</a>
733 <div class="param-desc">
734 <p>Returns an array of valid htmode values for this radio. Currently
735 known mode values are:</p>
737 <li><code>HT20</code> - applicable to IEEE 802.11n, 20 MHz wide channels</li>
738 <li><code>HT40</code> - applicable to IEEE 802.11n, 40 MHz wide channels</li>
739 <li><code>VHT20</code> - applicable to IEEE 802.11ac, 20 MHz wide channels</li>
740 <li><code>VHT40</code> - applicable to IEEE 802.11ac, 40 MHz wide channels</li>
741 <li><code>VHT80</code> - applicable to IEEE 802.11ac, 80 MHz wide channels</li>
742 <li><code>VHT160</code> - applicable to IEEE 802.11ac, 160 MHz wide channels</li>
754 <span class="param-type">Array.<string></span>
772 <h4 class="name" id="getHWModes"><span class="type-signature"></span>getHWModes<span class="signature">()</span><span class="type-signature"> → {Array.<string>}</span></h4>
779 <div class="description">
780 <p>Gets a list of supported hwmodes.</p>
781 <p>The hwmode values describe the frequency band and wireless standard
782 versions supported by the wireless phy.</p>
824 <dt class="tag-source">Source:</dt>
825 <dd class="tag-source"><ul class="dummy"><li>
826 <a href="network.js.html">network.js</a>, <a href="network.js.html#line3054">line 3054</a>
854 <div class="param-desc">
855 <p>Returns an array of valid hwmode values for this radio. Currently
856 known mode values are:</p>
858 <li><code>a</code> - Legacy 802.11a mode, 5 GHz, up to 54 Mbit/s</li>
859 <li><code>b</code> - Legacy 802.11b mode, 2.4 GHz, up to 11 Mbit/s</li>
860 <li><code>g</code> - Legacy 802.11g mode, 2.4 GHz, up to 54 Mbit/s</li>
861 <li><code>n</code> - IEEE 802.11n mode, 2.4 or 5 GHz, up to 600 Mbit/s</li>
862 <li><code>ac</code> - IEEE 802.11ac mode, 5 GHz, up to 6770 Mbit/s</li>
874 <span class="param-type">Array.<string></span>
892 <h4 class="name" id="getI18n"><span class="type-signature"></span>getI18n<span class="signature">()</span><span class="type-signature"> → {string}</span></h4>
899 <div class="description">
900 <p>Get a string describing the wireless radio hardware.</p>
942 <dt class="tag-source">Source:</dt>
943 <dd class="tag-source"><ul class="dummy"><li>
944 <a href="network.js.html">network.js</a>, <a href="network.js.html#line3086">line 3086</a>
972 <div class="param-desc">
973 <p>Returns the description string.</p>
984 <span class="param-type">string</span>
1002 <h4 class="name" id="getName"><span class="type-signature"></span>getName<span class="signature">()</span><span class="type-signature"> → {string}</span></h4>
1009 <div class="description">
1010 <p>Get the configuration name of this wireless radio.</p>
1025 <dl class="details">
1052 <dt class="tag-source">Source:</dt>
1053 <dd class="tag-source"><ul class="dummy"><li>
1054 <a href="network.js.html">network.js</a>, <a href="network.js.html#line3035">line 3035</a>
1082 <div class="param-desc">
1083 <p>Returns the UCI section name (e.g. <code>radio0</code>) of the corresponding
1084 radio configuration which also serves as unique logical identifier
1085 for the wireless phy.</p>
1096 <span class="param-type">string</span>
1114 <h4 class="name" id="getScanList"><span class="type-signature"></span>getScanList<span class="signature">()</span><span class="type-signature"> → {Promise.<Array.<<a href="LuCI.Network.html#.WifiScanResult">LuCI.Network.WifiScanResult</a>>>}</span></h4>
1121 <div class="description">
1122 <p>Trigger a wireless scan on this radio device and obtain a list of
1123 nearby networks.</p>
1138 <dl class="details">
1165 <dt class="tag-source">Source:</dt>
1166 <dd class="tag-source"><ul class="dummy"><li>
1167 <a href="network.js.html">network.js</a>, <a href="network.js.html#line3147">line 3147</a>
1195 <div class="param-desc">
1196 <p>Returns a promise resolving to an array of scan result objects
1197 describing the networks found in the vincinity.</p>
1208 <span class="param-type">Promise.<Array.<<a href="LuCI.Network.html#.WifiScanResult">LuCI.Network.WifiScanResult</a>>></span>
1226 <h4 class="name" id="getWifiNetwork"><span class="type-signature"></span>getWifiNetwork<span class="signature">(network)</span><span class="type-signature"> → {Promise.<<a href="LuCI.Network.WifiNetwork.html">LuCI.Network.WifiNetwork</a>>}</span></h4>
1233 <div class="description">
1234 <p>Get the wifi network of the given name belonging to this radio device</p>
1245 <h5>Parameters:</h5>
1248 <table class="params">
1261 <th class="last">Description</th>
1270 <td class="name"><code>network</code></td>
1276 <span class="param-type">string</span>
1286 <td class="description last"><p>The name of the wireless network to lookup. This may be either an uci
1287 configuration section ID, a network ID in the form <code>radio#.network#</code>
1288 or a Linux network device name like <code>wlan0</code> which is resolved to the
1289 corresponding configuration section through <code>ubus</code> runtime information.</p></td>
1301 <dl class="details">
1328 <dt class="tag-source">Source:</dt>
1329 <dd class="tag-source"><ul class="dummy"><li>
1330 <a href="network.js.html">network.js</a>, <a href="network.js.html#line3180">line 3180</a>
1358 <div class="param-desc">
1359 <p>Returns a promise resolving to a <code>Network.WifiNetwork</code> instance
1360 representing the wireless network and rejecting with <code>null</code> if
1361 the given network could not be found or is not associated with
1362 this radio device.</p>
1373 <span class="param-type">Promise.<<a href="LuCI.Network.WifiNetwork.html">LuCI.Network.WifiNetwork</a>></span>
1391 <h4 class="name" id="getWifiNetworks"><span class="type-signature"></span>getWifiNetworks<span class="signature">()</span><span class="type-signature"> → {Promise.<Array.<<a href="LuCI.Network.WifiNetwork.html">LuCI.Network.WifiNetwork</a>>>}</span></h4>
1398 <div class="description">
1399 <p>Get all wireless networks associated with this wireless radio device.</p>
1414 <dl class="details">
1441 <dt class="tag-source">Source:</dt>
1442 <dd class="tag-source"><ul class="dummy"><li>
1443 <a href="network.js.html">network.js</a>, <a href="network.js.html#line3199">line 3199</a>
1471 <div class="param-desc">
1472 <p>Returns a promise resolving to an array of <code>Network.WifiNetwork</code>
1473 instances respresenting the wireless networks associated with this
1485 <span class="param-type">Promise.<Array.<<a href="LuCI.Network.WifiNetwork.html">LuCI.Network.WifiNetwork</a>>></span>
1503 <h4 class="name" id="isDisabled"><span class="type-signature"></span>isDisabled<span class="signature">()</span><span class="type-signature"> → {boolean}</span></h4>
1510 <div class="description">
1511 <p>Checks whether this wireless radio is disabled.</p>
1526 <dl class="details">
1553 <dt class="tag-source">Source:</dt>
1554 <dd class="tag-source"><ul class="dummy"><li>
1555 <a href="network.js.html">network.js</a>, <a href="network.js.html#line3023">line 3023</a>
1583 <div class="param-desc">
1584 <p>Returns <code>true</code> when the wireless radio is marked as disabled in <code>ubus</code>
1585 runtime state or when the <code>disabled</code> option is set in the corresponding
1586 UCI configuration.</p>
1597 <span class="param-type">boolean</span>
1615 <h4 class="name" id="isUp"><span class="type-signature"></span>isUp<span class="signature">()</span><span class="type-signature"> → {boolean}</span></h4>
1622 <div class="description">
1623 <p>Check whether the wireless radio is marked as up in the <code>ubus</code>
1639 <dl class="details">
1666 <dt class="tag-source">Source:</dt>
1667 <dd class="tag-source"><ul class="dummy"><li>
1668 <a href="network.js.html">network.js</a>, <a href="network.js.html#line3158">line 3158</a>
1696 <div class="param-desc">
1697 <p>Returns <code>true</code> when the radio device is up, else <code>false</code>.</p>
1708 <span class="param-type">boolean</span>
1726 <h4 class="name" id="set"><span class="type-signature"></span>set<span class="signature">(opt, val)</span><span class="type-signature"></span></h4>
1733 <div class="description">
1734 <p>Set the given UCI option of this network to the given value.</p>
1745 <h5>Parameters:</h5>
1748 <table class="params">
1761 <th class="last">Description</th>
1770 <td class="name"><code>opt</code></td>
1776 <span class="param-type">string</span>
1786 <td class="description last"><p>The name of the UCI option to set.</p></td>
1793 <td class="name"><code>val</code></td>
1799 <span class="param-type">null</span>
1802 <span class="param-type">string</span>
1805 <span class="param-type">Array.<string></span>
1815 <td class="description last"><p>The value to set or <code>null</code> to remove the given option from the
1816 configuration.</p></td>
1828 <dl class="details">
1855 <dt class="tag-source">Source:</dt>
1856 <dd class="tag-source"><ul class="dummy"><li>
1857 <a href="network.js.html">network.js</a>, <a href="network.js.html#line3011">line 3011</a>
1903 <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="LuCI.html">LuCI</a></li><li><a href="LuCI.Class.html">Class</a></li><li><a href="LuCI.dom.html">dom</a></li><li><a href="LuCI.fs.html">fs</a></li><li><a href="LuCI.Headers.html">Headers</a></li><li><a href="LuCI.Network.html">Network</a></li><li><a href="LuCI.Network.Device.html">Device</a></li><li><a href="LuCI.Network.Hosts.html">Hosts</a></li><li><a href="LuCI.Network.Protocol.html">Protocol</a></li><li><a href="LuCI.Network.WifiDevice.html">WifiDevice</a></li><li><a href="LuCI.Network.WifiNetwork.html">WifiNetwork</a></li><li><a href="LuCI.Poll.html">Poll</a></li><li><a href="LuCI.Request.html">Request</a></li><li><a href="LuCI.Request.poll.html">poll</a></li><li><a href="LuCI.Response.html">Response</a></li><li><a href="LuCI.rpc.html">rpc</a></li><li><a href="LuCI.uci.html">uci</a></li><li><a href="LuCI.view.html">view</a></li><li><a href="LuCI.XHR.html">XHR</a></li></ul>
1909 Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time)
1912 <script> prettyPrint(); </script>
1913 <script src="scripts/linenumber.js"> </script>