new LuCI.network.WifiNetwork()
Methods
-
disconnectClient(mac, deauth, reason, ban_time){Promise.<number>}
-
Forcibly disconnect the given client from the wireless network.
Name Type Default Description macstring The MAC address of the client to disconnect.
deauthboolean false optional Specifies whether to de-authenticate (
true) or disassociate (false) the client.reasonnumber 1 optional Specifies the IEEE 802.11 reason code to disassoc/deauth the client with. Default is
1which corresponds toUnspecified reason.ban_timenumber 0 optional Specifies the number of milliseconds to ban the client from reconnecting. By default, no ban time is set which allows the client to re-associate / reauthenticate immediately.
Returns:
Type Description Promise.<number> Returns a promise resolving to the underlying ubus call result code which is typically 0, even for not existing MAC addresses. The promise might reject with an error in case invalid arguments are passed. -
get(opt){null|string|Array.<string>}
-
Read the given UCI option value of this wireless network.
Name Type Description optstring The UCI option name to read.
Returns:
Type Description null | string | Array.<string> Returns the UCI option value or nullif the requested option is not found. -
getActiveBSSID(){string}
-
Query the current BSSID from runtime information.
Returns:
Type Description string Returns the current BSSID or Mesh ID as reported by ubusruntime information. -
getActiveEncryption(){string}
-
Query the current encryption settings from runtime information.
Returns:
Type Description string Returns a string describing the current encryption or -if the encryption state could not be found inubusruntime information. -
getActiveMode(){string}
-
Query the current operation mode from runtime information.
Returns:
Type Description string Returns the human readable mode name as reported by iwinfo or uci mode. Possible returned values are: MasterAd-HocClientMonitorMaster (VLAN)WDSMesh PointP2P ClientP2P GoUnknown
-
getActiveModeI18n(){string}
-
Query the current operation mode from runtime information as translated string.
Returns:
Type Description string Returns the translated, human readable mode name as reported by ubusruntime state. -
getActiveSSID(){string}
-
Query the current SSID from runtime information.
Returns:
Type Description string Returns the current SSID or Mesh ID as reported by ubusruntime information. -
getAssocList(){Promise.<Array.<LuCI.network.WifiPeerEntry>>}
-
Fetch the list of associated peers.
Returns:
Type Description Promise.<Array.<LuCI.network.WifiPeerEntry>> Returns a promise resolving to an array of wireless peers associated with this network. -
getBitRate(){null|number}
-
Query the current average bit-rate of all peers associated with this wireless network.
Returns:
Type Description null | number Returns the average bit rate among all peers associated with the network as reported by ubusruntime information ornullif the information is not available. -
getBSSID(){null|string}
-
Get the configured BSSID of the wireless network.
Returns:
Type Description null | string Returns the BSSID value or nullif none has been specified. -
getChannel(){null|number}
-
Query the current wireless channel.
Returns:
Type Description null | number Returns the wireless channel as reported by ubusruntime information ornullif it cannot be determined. -
getCountryCode(){string}
-
Query the current country code.
Returns:
Type Description string Returns the wireless country code as reported by ubusruntime information or00if it cannot be determined. -
getDevice(){LuCI.network.Device}
-
Get the associated Linux network device.
Returns:
Type Description LuCI.network.Device Returns a Network.Deviceinstance representing the Linux network device associated with this wireless network. -
getFrequency(){null|string}
-
Query the current operating frequency of the wireless network.
Returns:
Type Description null | string Returns the current operating frequency of the network from ubusruntime information in GHz ornullif the information is not available. -
getI18n(){string}
-
Get a description string for this wireless network.
Returns:
Type Description string Returns a string describing this network, consisting of the term Wireless Network, followed by the active operation mode, the SSID, BSSID or internal network ID and the Linux network device name, depending on which information is available. -
getID(){string}
-
Get the internal network ID of this wireless network.
The network ID is a LuCI specific identifier in the form
radio#.network#to identify wireless networks by their corresponding radio and network index numbers.Returns:
Type Description string Returns the LuCI specific network ID. -
getIfname(){null|string}
-
Get the Linux network device name.
Returns:
Type Description null | string Returns the current Linux network device name as resolved from ubusruntime information ornullif this network has no associated network device, e.g. when not configured or up. -
getMeshID(){null|string}
-
Get the configured Mesh ID of the wireless network.
Returns:
Type Description null | string Returns the configured mesh ID value or nullwhen this network is not in mesh mode. -
getMode(){string}
-
Get the configured operation mode of the wireless network.
Returns:
Type Description string Returns the configured operation mode. Possible values are: ap- Master (Access Point) modesta- Station (client) modeadhoc- Ad-Hoc (IBSS) modemesh- Mesh (IEEE 802.11s) modemonitor- Monitor mode
-
getName(){string}
-
Get the configuration ID of this wireless network.
Returns:
Type Description string Returns the corresponding UCI section ID of the network. -
getNetwork(){null|LuCI.network.Protocol}
-
Get the primary logical interface this network is attached to.
Returns:
Type Description null | LuCI.network.Protocol Returns a Network.Protocolinstance representing the logical interface ornullif this network is not attached to any logical interface. -
getNetworkNames(){Array.<string>}
-
Get the names of the logical interfaces this wireless network is attached to.
Returns:
Type Description Array.<string> Returns an array of logical interface names. -
getNetworks(){Array.<LuCI.network.Protocol>}
-
Get the logical interfaces this network is attached to.
Returns:
Type Description Array.<LuCI.network.Protocol> Returns an array of Network.Protocolinstances representing the logical interfaces this wireless network is attached to. -
getNoise(){number}
-
Query the current radio noise floor.
Returns:
Type Description number Returns the radio noise floor in dBm as reported by ubusruntime information or0if it cannot be determined. -
getShortName(){string}
-
Get a short description string for this wireless network.
Returns:
Type Description string Returns a string describing this network, consisting of the active operation mode, followed by either the SSID, BSSID or internal network ID, depending on which information is available. -
getSignal(){null|number}
-
Query the current wireless signal.
Returns:
Type Description null | number Returns the wireless signal in dBm as reported by ubusruntime information ornullif it cannot be determined. -
getSignalLevel(){number}
-
Calculate the current signal.
- Deprecated
- Yes
Returns:
Type Description number Returns the calculated signal level, which is the difference between noise and signal (SNR), divided by 5. -
getSignalPercent(){number}
-
Calculate the current signal quality percentage.
Returns:
Type Description number Returns the calculated signal quality in percent. The value is calculated from the qualityandquality_maxindicators reported byubusruntime state. -
getSSID(){null|string}
-
Get the configured SSID of the wireless network.
Returns:
Type Description null | string Returns the configured SSID value or nullwhen this network is in mesh mode. -
getTXPower(){null|number}
-
Query the current radio TX power.
Returns:
Type Description null | number Returns the wireless network transmit power in dBm as reported by ubusruntime information ornullif it cannot be determined. -
getTXPowerOffset(){number}
-
Query the radio TX power offset.
Some wireless radios have a fixed power offset, e.g. due to the use of external amplifiers.
Returns:
Type Description number Returns the wireless network transmit power offset in dBm as reported by ubusruntime information or0if there is no offset, or if it cannot be determined. -
getVlanIfnames(){Array.<string>}
-
Get the Linux VLAN network device names.
Returns:
Type Description Array.<string> Returns the current Linux VLAN network device name as resolved from ubusruntime information or empty array if this network has no associated VLAN network devices. -
getVlans(){Array.<LuCI.network.WifiVlan>}
-
Fetch the vlans for this network.
Returns:
Type Description Array.<LuCI.network.WifiVlan> Returns an array of vlans for this network. -
getWifiDevice(){null|LuCI.network.WifiDevice}
-
Get the corresponding WiFi radio device.
Returns:
Type Description null | LuCI.network.WifiDevice Returns a Network.WifiDeviceinstance representing the corresponding WiFi radio device ornullif the related radio device could not be found. -
getWifiDeviceName(){null|string}
-
Get the name of the corresponding WiFi radio device.
Returns:
Type Description null | string Returns the name of the radio device this network is configured on or nullif it cannot be determined. -
isClientDisconnectSupported(){boolean}
-
Check whether this WiFi network supports de-authenticating clients.
Returns:
Type Description boolean Returns truewhen this WiFi network instance supports forcibly de-authenticating clients, otherwisefalse. -
isDisabled(){boolean}
-
Checks whether this wireless network is disabled.
Returns:
Type Description boolean Returns truewhen the wireless radio is marked as disabled inubusruntime state or when thedisabledoption is set in the corresponding UCI configuration. -
isUp(){boolean}
-
Check whether the radio network is up.
This function actually queries the up state of the related radio device and assumes this network to be up as well when the parent radio is up. This is due to the fact that OpenWrt does not control virtual interfaces individually but within one common hostapd instance.
Returns:
Type Description boolean Returns truewhen the network is up, elsefalse. -
set(opt, value)
-
Set the given UCI option of this network to the given value.
Name Type Description optstring The name of the UCI option to set.
valuenull | string | Array.<string> The value to set or
nullto remove the given option from the configuration.