Method Summary
|
applySettings
(
|
Apply the provided settings. |
| getConnectedAccessPointInfo ( ) → apInfo |
Returns the currently connected access point. |
| getNetworkInfo ( ) → networkInfo | Returns the current network info. |
| getSettings ( ) → settings |
Returns the network settings. |
|
scanWifi
(
|
This asynchronous method scans for available APs. |
Inherited Methods
|
addEventListener
(
|
This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners. |
|
removeEventListener
(
|
This method removes an event listener for a specific event. |
Type Definitions
|
The IP address acquisition method. |
|
|
Specifies the address scope where this network's IP address is valid. |
|
|
Specifies the availability of a particular feature for a device. |
|
|
Controls the type of device that will be used by a network. |
|
|
Specifies whether the device can handle full-duplex or half-duplex mode. |
|
|
Specifies the IP version. |
|
|
DNS name server IP address. |
|
|
|
|
|
Desired domain search path. |
|
|
|
|
|
Specifies the network state. |
|
|
Wi-Fi authentication types. Note: This enum is deprecated and has been replaced by ToiNetwork.ToiWifiSecurity. |
|
|
Wi-Fi radio band. |
|
|
Wi-Fi encryption methods. Note: This enum is deprecated and has been replaced by ToiNetwork.ToiWifiSecurity. |
|
|
Wi-Fi events. |
|
|
Wi-Fi modes. |
|
|
Wi-Fi security methods. This enum contains the available security combinations. Each name is formatted as WIFISECURITY<link authentication>[<security protocol><encryption>]. (Link authentication is a legacy term that only has any meaning when using WEP. It is not authentication in the modern sense of the word.) |
|
Methods
This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners.
Inherited From:
Parameters:
-
Name Type Description typenumber The event type of the event to subscribe to.
listenerToiEventListener The JavaScript function that will receive events.
Throws:
-
ToiInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the application calls addEventListener with the same combination of type and listener twice.
This method applies the provided network settings. It is possible to omit optional properties in which case those settings will remain unchanged. The method may fail and throw an exception if the provided settings do not lie within the network's capabilities. Besides this, the method will always succeed. Waiting for the asynchonous callback does not guarantee that any settings have been applied.
Note that a network's settings are applied in many other places besides calls to this method, for example when the box is booting or when link status changes. Because of this, the network's state is the only safe way to detect failures to apply the settings since it may depend on external factors.
Parameters:
-
Name Type Description callbacksAsyncCallback Object with callback functions for the asynchronous operation. No result is produced by this method, so callbacks.onResult() will not be invoked.
settingsToiNetwork.ToiSettings A set of network settings to apply.
Throws:
-
ToiInvalidArgumentException Raised if an invalid operation identifier was passed or if the provided settings do not lie within the network's capabilities.
Returns:
-
Type: ToiAsynchronousOperation
operation The asynchronous operation created by the function.
Returns the currently connected access point.
Throws:
-
ToiInvalidPreconditionException Raised if the Wi-Fi interface is not enabled or if the Wi-Fi device is not up.
Returns:
-
Type: ToiNetwork.ToiWifiAccessPointInfo
Access point information.
This method returns the current status of the network.
Returns:
-
Type: ToiNetwork.ToiInformation
The current network info.
Returns the network settings.
Returns:
-
Type: ToiNetwork.ToiSettings
The current network settings for this network.
This method removes an event listener for a specific event.
Inherited From:
Parameters:
-
Name Type Description typenumber The event type of the event to remove the listener from.
listenerToiEventListener The JavaScript function that was previously added as an event listener.
Throws:
-
ToiInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the listener has not previously been added.
This asynchronous method scans for available APs.
Parameters:
-
Name Type Description callbacksAsyncCallback Object with callback functions for the asynchronous operation. The callbacks.onResult() will be invoked with any incremental results of type Array.<ToiNetwork.ToiWifiAccessPointInfo>. The final and accumulated result will be available as the property 'result' in the operation object after callbacks.onCompleted() has been invoked.
ssid
[optional]string The network name to scan for. Setting this parameter has no effect; all APs will be passively scanned.
Throws:
-
ToiInvalidArgumentException Raised if an invalid operation identifier passed.
ToiBusyException Raised if a scan already in progress.
ToiInvalidPreconditionException Raised if the Wi-Fi interface is not enabled or if the Wi-Fi device is not up.
Returns:
-
Type: ToiAsynchronousOperation
operation The asynchronous operation created by the function.
Members
This is an Event identifier for ToiNetworkNetworkInfoChangedEvent.
Called when the network's info changes.
This is an Event identifier for ToiNetworkWifiChangedEvent.
Called when something happens to the wifi network.
Acquire both IPv4 and IPv6 addresses via DHCP.
Acquire only IPv4 address via DHCP.
Acquire only IPv6 address via DHCP.
Disable any automatic address acquisition and instead use static settings.
The address is globally valid.
The address is only valid on this host.
The address is only valid for use on the local network.
(IPV6 only) The address is only valid for use on this site. (Deprecated in RFC 4291, should be treated as global.)
Indicates whether auto negotiation is enabled.
Indicates whether flow control is enabled.
Indicates whether jumbo packets are enabled.
Indicates whether the WOL feature is enabled.
Instructs the network to choose device automatically at boot. Runtime auto selection is not supported.
Instructs the network that Ethernet should be used.
Instructs the network that Wi-Fi should be used.
Specifies full-duplex mode.
Specifies half-duplex mode.
Specifies that the duplex mode is unknown.
The interface is of Ethernet type.
The interface is of Wi-Fi type.
IP version 4, implies the InterNetwork address family.
IP version 6, implies the InterNetwork6 address family.
The network is currently not managed by the platform.
The provided settings could not be used to establish a network connection. New settings need to be provided.
The network has been successfully configured and is ready to be used.
The network is currently applying its settings.
Designates the open authentication method.
Note: ToiNetwork.ToiWifiAuthenticationType is deprecated and has been replaced by ToiNetwork.ToiWifiSecurity.
Designates the shared authentication method. Deprecated in 802.11-2012 and should only be used for backward compatibility.
Note: ToiNetwork.ToiWifiAuthenticationType is deprecated and has been replaced by ToiNetwork.ToiWifiSecurity.
Designates an unsupported authentication method.
Note: ToiNetwork.ToiWifiAuthenticationType is deprecated and has been replaced by ToiNetwork.ToiWifiSecurity.
Designates WPA2 authentication with a pre-shared key. Can be combined with ToiNetwork.WIFI_ENCRYPTION_TYPE_TKIP or ToiNetwork.WIFI_ENCRYPTION_TYPE_AES_CCMP.
Note: ToiNetwork.ToiWifiAuthenticationType is deprecated and has been replaced by ToiNetwork.ToiWifiSecurity.
Designates WPA authentication with a pre-shared key. Can be combined with ToiNetwork.WIFI_ENCRYPTION_TYPE_TKIP or ToiNetwork.WIFI_ENCRYPTION_TYPE_AES_CCMP.
Note: ToiNetwork.ToiWifiAuthenticationType is deprecated and has been replaced by ToiNetwork.ToiWifiSecurity.
Designates WPS authentication. Encryption type is ignored with this type of authentication.
Note: ToiNetwork.ToiWifiAuthenticationType is deprecated and has been replaced by ToiNetwork.ToiWifiSecurity.
Designates the 2.4 GHz band.
Designates the 5 GHz band.
Wi-Fi link to the AP is established.
Wi-Fi adapter is connecting to the AP.
Wi-Fi link is lost.
Designates AES CCMP-style encryption.
Note: ToiNetwork.ToiWifiEncryptionType is deprecated and has been replaced by ToiNetwork.ToiWifiSecurity.
Encryption not used.
Note: ToiNetwork.ToiWifiEncryptionType is deprecated and has been replaced by ToiNetwork.ToiWifiSecurity.
Designates TKIP-style encryption.
Note: ToiNetwork.ToiWifiEncryptionType is deprecated and has been replaced by ToiNetwork.ToiWifiSecurity.
Designates an unsupported encryption method.
Note: ToiNetwork.ToiWifiEncryptionType is deprecated and has been replaced by ToiNetwork.ToiWifiSecurity.
Designates WEP-style encryption. Only available together with ToiNetwork.WIFI_AUTHENTICATION_TYPE_SHARED.
Note: ToiNetwork.ToiWifiEncryptionType is deprecated and has been replaced by ToiNetwork.ToiWifiSecurity.
Wi-Fi connection failed, bad authentication.
Wi-Fi connection failed, AP unavailable.
Wi-Fi connection failed due to internal error.
Wi-Fi connection failed, time out.
Wi-Fi connection failed, several APs with WPS active at the same time.
802.11A
802.11AC
802.11B
802.11G
802.11N
Automatic choice of mode.
Instructs the network to choose security method automatically.
Allow unauthenticated/unencrypted Wi-Fi.
Allow WEP with open system authentication.
Allow WPA2 with pre-shared key using the CCMP protocol.
Allow WPA2 with pre-shared key using the TKIP protocol.
Allow WPA with pre-shared key using the TKIP protocol.
Allow WEP with shared key authentication.
Allow WPS.
Wi-Fi adapter has finished handshaking.
Wi-Fi adapter is in pairing mode.
Wi-Fi adapter has finished scanning.
Specifies a network's capabilities.
Struct fields
| Name | Description |
|---|---|
| hasIpv6 | IPv6 support. Type: boolean |
| hasWifi | Indicates whether the network has access to a Wi-Fi enabled device. Type: boolean |
| isConfigurable | A configurable network allows changes to its settings. Type: boolean |
| isIpRequired | Indicates whether at least one IP address is required (static or dynamic). If the address acquisition method is none then there must be at least one static IP address configured. Type: boolean |
| maxAddressEntries | Maximum number of IP address entries. Type: number |
| maxDnsEntries | Maximum number of DNS entries. Type: number |
| maxRouteEntries | Maximum number of route entries (i.e. default gateways). Type: number |
| supportedWifiSecurity | The supported Wi-Fi security protocols as a bitmask of ToiNetwork.ToiWifiSecurity values. Type: number |
Specifies DHCP related information about a network.
Struct fields
| Name | Description |
|---|---|
| leaseRemainingTime | Remaining time in seconds of the IP address lease. Type: number |
| leaseTime | IP address lease time in seconds. Type: number |
| renewalAttemptCount | Number of renewal attempts. Type: number |
| renewalSuccessCount | Number of successful renewal attempts. Type: number |
| serverIpAddress
[optional] |
IP address of DHCP server. Type: string |
Specifies static DNS info for a network.
Struct fields
| Name | Description |
|---|---|
| nameServers | A list of DNS name server IP addresses (strings). This can be both IPv4 and IPv6 addresses. Note that TOI always provides an Array, even if there is only a single value. Type: Array.<ToiNetwork.ToiNameServer> (Or a single ToiNetwork.ToiNameServer.) |
| searchPaths | A list of DNS search paths (strings). Note that search path settings are not persistent across reboots. Note that TOI always provides an Array, even if there is only a single value. Type: Array.<ToiNetwork.ToiSearchPath> (Or a single ToiNetwork.ToiSearchPath.) |
Describes the current status of the network.
Struct fields
| Name | Description |
|---|---|
| capabilities | Specifies the network's capabilities. This determines if and how the network can be configured and used. Type: ToiNetwork.ToiCapabilities |
| dnsInfo | The current DNS info. Type: ToiNetwork.ToiDnsInfo |
| interfaceInfo | The current interface info, such as IP address, statistics and more. Type: ToiNetwork.ToiInterfaceInfo |
| routes | The network's routes. Note that TOI always provides an Array, even if there is only a single value. Type: Array.<ToiNetwork.ToiRoute> (Or a single ToiNetwork.ToiRoute.) |
| state | The current network state indicating whether the network is ready to be used. Type: ToiNetwork.ToiState |
Struct fields
| Name | Description |
|---|---|
| duplexMode | Specifies the duplex mode used by the device. Type: ToiNetwork.ToiDuplexMode |
| features | A bit mask defined in ToiNetwork.ToiDeviceFeature specifying which features are available on the device. Type: number |
| hasLink | Indicates whether the interface has link. Type: boolean |
| ipAddresses | IP addresses associated with this interface. Note that TOI always provides an Array, even if there is only a single value. Type: Array.<ToiNetwork.ToiIpAddressInfo> (Or a single ToiNetwork.ToiIpAddressInfo.) |
| linkSpeed | The negotiated link speed in Mbit/s. Type: number |
| mac | The hardware address (MAC). Type: string |
| name | The interface's name. Type: string |
| statistics | The interface statistics. Type: ToiNetwork.ToiInterfaceStatistics |
| type | The interface type (Ethernet or Wi-Fi). Type: ToiNetwork.ToiInterfaceType |
| wifiInfo
[optional] |
Wi-Fi specific interface information. Type: ToiNetwork.ToiInterfaceWifiInfo |
Network interface statistics.
Struct fields
| Name | Description |
|---|---|
| broadcastPacketsReceived | The total number of broadcast packets received on the device (IPv4 only). Type: number |
| broadcastPacketsSent | The total number of broadcast packets transmitted out of the device (IPv4 only). Type: number |
| bytesReceived | The total number of bytes received on the device. Type: number |
| bytesSent | The total number of bytes transmitted out of the device. Type: number |
| connectivityLossCount | The count of phy layer loss since last reboot. Type: number |
| discardPacketsReceived | The total number of unicast packets received on the device. Type: number |
| discardPacketsSent | The total number of discard packets transmitted out of the device. Type: number |
| errorsReceived | The total number of packets that could not be received on the device by the higher-layer protocol due to errors. Type: number |
| errorsSent | The total number of packets that could not be transmitted out of the device due to errors. Type: number |
| multicastPacketsReceived | The total number of multicast packets received on the device. Type: number |
| multicastPacketsSent | The total number of multicast packets transmitted out of the device. Type: number |
| packetsReceived | The total number of packets received on the device. Type: number |
| packetsSent | The total number of packets transmitted out of the device. Type: number |
| unicastPacketsReceived | The total number of unicast packets received on the device. Type: number |
| unicastPacketsSent | The total number of unicast packets transmitted out of the device. Type: number |
| unknownProtoPacketsReceived | The total number of packets received on the device which are discarded because of an unknown or unsupported protocol. Type: number |
Struct fields
| Name | Description |
|---|---|
| channelBandwidth | Max channel bandwidth. Type: number |
| regulatoryDomain | The regulatory domain used by the interface. Type: string |
| state | The last Wi-Fi state event reported. Type: ToiNetwork.ToiWifiEvent |
| wifiStatistics | Wi-Fi related interface statistics. Type: ToiNetwork.ToiInterfaceWifiStatistics |
Struct fields
| Name | Description |
|---|---|
| measuredRate | Measured bit rate at the Wi-Fi interface in MiB/s. Note: This field is deprecated. Use ToiInterfaceStatistics instead. Type: number |
| retransmissionCount | Number of retransmissions. Not necessarily the same as the number of dropped packets which is an IP metric. Type: number |
| signalNoiseRatio | Signal-to-noise ratio in tenths of a dB, i.e. the value 251 means 25.1 dB. When the receiver does not have channel lock this value is -1. Type: number |
Describes an IP network address used for a network's static IP settings.
Struct fields
| Name | Description |
|---|---|
| ipAddress | An IPv4 or IPv6 address (not including netmask/routing prefix). Type: string |
| label
[optional] |
An address label used to identify the address. This label will be appended to the real interface address label after the interface name. Type: string |
| netmask | A netmask to use for subnetting. Can be specified using either dot-decimal or CIDR notation (e.g. 255.255.255.0 or /24). Type: string |
Specifies an IP address. This can be an IP assigned by a DHCP server in which case the DHCP client status can be retrieved from this structure.
Struct fields
| Name | Description |
|---|---|
| addressScope | The address scope of the address of this network. This controls where this address is valid. Type: ToiNetwork.ToiAddressScope |
| dhcpInfo
[optional] |
The current status of the DHCP client. The value will be undefined if this IP was not acquired by DHCP. Type: ToiNetwork.ToiDhcpInfo |
| ipAddress | The IP address. Type: string |
| ipVersion | The IP address version. Type: ToiNetwork.ToiIpVersion |
| netmask | The netmask in dot-decimal notation (e.g. 255.255.255.0). Type: string |
This data type contains permanent network settings used to configure the underlying network interface and network-related tables and tools.
Struct fields
| Name | Description |
|---|---|
| addressAcquisitionMethod
[optional] |
The acquisition method specifies how network addresses are acquired. They are usually acquired from a DHCP server, including IP address, DNS paths and default gateway. Type: ToiNetwork.ToiAddressAcquisitionMethod |
| deviceSelection
[optional] |
The type of device that should be used. Type: ToiNetwork.ToiDeviceSelection |
| staticSettings
[optional] |
The network may contain static configuration, not obtained from a DHCP server. This includes static IP addresses, DNS and routing information such as default gateway. Note that static settings can be used together with DHCP. Type: ToiNetwork.ToiStaticSettings |
| wifiSettings
[optional] |
The Wi-Fi settings property includes Wi-Fi related settings only applicable for networks using a Wi-Fi network interface adapter. Type: ToiNetwork.ToiWifiSettings |
This data type specifies all the available static settings for a network. Note that Wi-Fi settings are only applicable for networks using a Wi-Fi network interface.
Link-local addresses are assigned automatically to interfaces and should not be provided manually.
Struct fields
| Name | Description |
|---|---|
| dnsInfo
[optional] |
Static DNS info to use for this network. Note that this is used in combination with any DNS information obtained from a DHCP server. This behavior may change in the future. Type: ToiNetwork.ToiDnsInfo |
| ipAddresses
[optional] |
Specifies a set of IP addresses to associate with the network's network interface. Usually only one address is required if DHCP is not used. Note that TOI always provides an Array, even if there is only a single value. Type: Array.<ToiNetwork.ToiIpAddress> (Or a single ToiNetwork.ToiIpAddress.) |
| routes
[optional] |
Static routes for this network. Used to specify default gateways. Note that TOI always provides an Array, even if there is only a single value. Type: Array.<ToiNetwork.ToiRoute> (Or a single ToiNetwork.ToiRoute.) |
Wi-Fi access point information.
Struct fields
| Name | Description |
|---|---|
| authentication | Authentication used by the AP. Note: This field is deprecated. Use Security and SupportedSecurity instead. Type: ToiNetwork.ToiWifiAuthenticationType |
| band | The radio band used by this access point. Type: ToiNetwork.ToiWifiBand |
| bssid | The BSSID of the access point. Type: string |
| channel | The channel used by the access point. Type: number |
| encryption | Encryption used by the AP. Note: This field is deprecated. Use Security and SupportedSecurity instead. Type: ToiNetwork.ToiWifiEncryptionType |
| isRcpiEnabled | Denotes whether received channel power indicator (RCPI) measurements can be provided. Type: boolean |
| isRssiEnabled | Denotes whether received signal strength indicator (RSSI) measurements can be provided. Type: boolean |
| isSupported | Indicates whether the AP provides at least one security combination accepted by the STB. Type: boolean |
| isWpsEnabled | Denotes whether the AP can handle WPS. Type: boolean |
| mode | Wi-Fi mode currently used by the AP. Type: ToiNetwork.ToiWifiMode |
| rcpi | RCPI. The value will range between -110 dBm to 0 dBm in increments of 0.5dBm. Type: double |
| rssi | RSSI. Note very carefully that this value is vendor specific. Type: double |
| security | Security used by the AP. Type: ToiNetwork.ToiWifiSecurity |
| ssid | The SSID of the access point. Type: string |
| supportedSecurity | Supported Wi-Fi security protocols as a bitmask of ToiNetwork.ToiWifiSecurity values. Type: number |
Wi-Fi settings. The network will automatically reconnect to the access point if these settings are changed.
Struct fields
| Name | Description |
|---|---|
| bssid
[optional] |
The BSSID of the AP to connect to. Type: string |
| presharedKey
[optional] |
Pre-shared key to use when connecting to the AP. This value can be omitted when using WPS. Type: string |
| security
[optional] |
The type of Wi-Fi security that should be used. If omitted, WIFI_SECURITY_AUTO will be assumed. Type: ToiNetwork.ToiWifiSecurity |
| ssid
[optional] |
The SSID of the AP to connect to if BSSID is omitted. Note that multiple APs may have the same SSID, in which case the AP with the best signal is chosen. Type: string |