- Source
Methods
disconnectClient(mac, deauthopt, reasonopt, ban_timeopt) → {Promise.<number>}
Forcibly disconnect the given client from the wireless network.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
mac | string | The MAC address of the client to disconnect. | ||
deauth | boolean | <optional> | false | Specifies whether to de-authenticate ( |
reason | number | <optional> | 1 | Specifies the IEEE 802.11 reason code to disassoc/deauth the client with. Default is |
ban_time | number | <optional> | 0 | 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. |
- Source
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.
- Type:
- Promise.<number>
get(opt) → {null|string|Array.<string>}
Read the given UCI option value of this wireless network.
| Name | Type | Description |
|---|---|---|
opt | string | The UCI option name to read. |
- Source
Returns the UCI option value or null if the requested option is not found.
- Type:
- null |
string | Array.<string>
getActiveBSSID() → {string}
Query the current BSSID from runtime information.
- Source
Returns the current BSSID or Mesh ID as reported by ubus runtime information.
- Type:
- string
getActiveEncryption() → {string}
Query the current encryption settings from runtime information.
- Source
Returns a string describing the current encryption or - if the encryption state could not be found in ubus runtime information.
- Type:
- string
getActiveMode() → {string}
Query the current operation mode from runtime information.
- Source
Returns the human readable mode name as reported by iwinfo or uci mode. Possible returned values are:
MasterAd-HocClientMonitorMaster (VLAN)WDSMesh PointP2P ClientP2P GoUnknown
- Type:
- string
getActiveModeI18n() → {string}
Query the current operation mode from runtime information as translated string.
- Source
Returns the translated, human readable mode name as reported by ubus runtime state.
- Type:
- string
getActiveSSID() → {string}
Query the current SSID from runtime information.
- Source
Returns the current SSID or Mesh ID as reported by ubus runtime information.
- Type:
- string
getAssocList() → {Promise.<Array.<LuCI.network.WifiPeerEntry>>}
Fetch the list of associated peers.
- Source
Returns a promise resolving to an array of wireless peers associated with this network.
- Type:
- Promise.<Array.<LuCI.network.WifiPeerEntry>>
getBSSID() → {null|string}
Get the configured BSSID of the wireless network.
- Source
Returns the BSSID value or null if none has been specified.
- Type:
- null |
string
getBitRate() → {null|number}
Query the current average bit-rate of all peers associated with this wireless network.
- Source
Returns the average bit rate among all peers associated with the network as reported by ubus runtime information or null if the information is not available.
- Type:
- null |
number
getChannel() → {null|number}
Query the current wireless channel.
- Source
Returns the wireless channel as reported by ubus runtime information or null if it cannot be determined.
- Type:
- null |
number
getCountryCode() → {string}
Query the current country code.
- Source
Returns the wireless country code as reported by ubus runtime information or 00 if it cannot be determined.
- Type:
- string
getDevice() → {LuCI.network.Device}
Get the associated Linux network device.
- Source
Returns a Network.Device instance representing the Linux network device associated with this wireless network.
- Type:
- LuCI.
network. Device
getFrequency() → {null|string}
Query the current operating frequency of the wireless network.
- Source
Returns the current operating frequency of the network from ubus runtime information in GHz or null if the information is not available.
- Type:
- null |
string
getI18n() → {string}
Get a description string for this wireless network.
- Source
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.
- Type:
- string
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.
- Source
Returns the LuCI specific network ID.
- Type:
- string
getIfname() → {null|string}
Get the Linux network device name.
- Source
Returns the current Linux network device name as resolved from ubus runtime information or null if this network has no associated network device, e.g. when not configured or up.
- Type:
- null |
string
getMeshID() → {null|string}
Get the configured Mesh ID of the wireless network.
- Source
Returns the configured mesh ID value or null when this network is not in mesh mode.
- Type:
- null |
string
getMode() → {string}
Get the configured operation mode of the wireless network.
- Source
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
- Type:
- string
getName() → {string}
Get the configuration ID of this wireless network.
- Source
Returns the corresponding UCI section ID of the network.
- Type:
- string
getNetwork() → {null|LuCI.network.Protocol}
Get the primary logical interface this network is attached to.
- Source
Returns a Network.Protocol instance representing the logical interface or null if this network is not attached to any logical interface.
- Type:
- null |
LuCI. network. Protocol
getNetworkNames() → {Array.<string>}
Get the names of the logical interfaces this wireless network is attached to.
- Source
Returns an array of logical interface names.
- Type:
- Array.<string>
getNetworks() → {Array.<LuCI.network.Protocol>}
Get the logical interfaces this network is attached to.
- Source
Returns an array of Network.Protocol instances representing the logical interfaces this wireless network is attached to.
- Type:
- Array.<LuCI.network.Protocol>
getNoise() → {number}
Query the current radio noise floor.
- Source
Returns the radio noise floor in dBm as reported by ubus runtime information or 0 if it cannot be determined.
- Type:
- number
getSSID() → {null|string}
Get the configured SSID of the wireless network.
- Source
Returns the configured SSID value or null when this network is in mesh mode.
- Type:
- null |
string
getShortName() → {string}
Get a short description string for this wireless network.
- Source
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.
- Type:
- string
getSignal() → {null|number}
Query the current wireless signal.
- Source
Returns the wireless signal in dBm as reported by ubus runtime information or null if it cannot be determined.
- Type:
- null |
number
getSignalLevel(signal, noise) → {number}
Calculate the current signal.
| Name | Type | Description |
|---|---|---|
signal | number | |
noise | number |
- Deprecated
- Yes
- Source
Returns the calculated signal level, which is the difference between noise and signal (SNR), divided by 5.
- Type:
- number
getSignalPercent() → {number}
Calculate the current signal quality percentage.
- Source
Returns the calculated signal quality in percent. The value is calculated from the quality and quality_max indicators reported by ubus runtime state.
- Type:
- number
getTXPower() → {null|number}
Query the current radio TX power.
- Source
Returns the wireless network transmit power in dBm as reported by ubus runtime information or null if it cannot be determined.
- Type:
- null |
number
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.
- Source
Returns the wireless network transmit power offset in dBm as reported by ubus runtime information or 0 if there is no offset, or if it cannot be determined.
- Type:
- number
getVlanIfnames() → {Array.<string>}
Get the Linux VLAN network device names.
- Source
Returns the current Linux VLAN network device name as resolved from ubus runtime information or empty array if this network has no associated VLAN network devices.
- Type:
- Array.<string>
getVlans() → {Array.<LuCI.network.WifiVlan>}
Fetch the vlans for this network.
- Source
Returns an array of vlans for this network.
- Type:
- Array.<LuCI.network.WifiVlan>
getWifiDevice() → {null|LuCI.network.WifiDevice}
Get the corresponding WiFi radio device.
- Source
Returns a Network.WifiDevice instance representing the corresponding WiFi radio device or null if the related radio device could not be found.
- Type:
- null |
LuCI. network. WifiDevice
getWifiDeviceName() → {null|string}
Get the name of the corresponding WiFi radio device.
- Source
Returns the name of the radio device this network is configured on or null if it cannot be determined.
- Type:
- null |
string
isClientDisconnectSupported() → {boolean}
Check whether this WiFi network supports de-authenticating clients.
- Source
Returns true when this WiFi network instance supports forcibly de-authenticating clients, otherwise false.
- Type:
- boolean
isDisabled() → {boolean}
Checks whether this wireless network is disabled.
- Source
Returns true when the wireless radio is marked as disabled in ubus runtime state or when the disabled option is set in the corresponding UCI configuration.
- Type:
- boolean
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.
- Source
Returns true when the network is up, else false.
- Type:
- boolean
set(opt, value) → {null}
Set the given UCI option of this network to the given value.
| Name | Type | Description |
|---|---|---|
opt | string | The name of the UCI option to set. |
value | null | | The value to set or |
- Source
- Type:
- null