Namespaces
Members
-
static,constantENABLE.network.ETHERNET_AUTHENTICATION_FAILEDString
-
IEEE 802.1X Ethernet authentication failed. This event is only sent when the device has been configured to use IEEE 802.1X authentication.
- Since:
- 1.3.0
-
static,constantENABLE.network.ETHERNET_AUTHENTICATION_SUCCESSString
-
IEEE 802.1X Ethernet authentication success. This event is only sent when the device has been configured to use IEEE 802.1X authentication.
- Since:
- 1.3.0
-
static,constantENABLE.network.ETHERNET_CONNECT_SUCCESSString
-
IEEE 802.1X connection was successful
- Since:
- 1.3.0
-
static,constantENABLE.network.NETWORK_INTERFACE_CHANGEDString
-
Network interface changed
- Since:
- 1.0.0
-
static,constantENABLE.network.NETWORK_IP_CHANGEDString
-
STB IP changed
- Since:
- 1.0.0
-
static,constantENABLE.network.NETWORK_LINK_STATUS_DOWNString
-
Network Link Status Down
- Since:
- 1.0.0
-
static,constantENABLE.network.NETWORK_LINK_STATUS_UPString
-
Network Link Status Up
- Since:
- 1.0.0
-
static,constantENABLE.network.NETWORK_READYString
-
Network Ready
- Since:
- 1.0.0
-
static,constantENABLE.network.SCAN_FAILEDString
-
WiFi Scanning failed
- Since:
- 1.0.1
-
static,constantENABLE.network.SCAN_RESULTS_AVAILABLEString
-
WiFi Scanning result is available
- Since:
- 1.0.1
-
static,constantENABLE.network.TYPE_DHCPString
-
Network IP type: DHCP
- Since:
- 1.0.0
-
static,constantENABLE.network.TYPE_STATICString
-
Network IP type: static
- Since:
- 1.0.0
-
static,constantENABLE.network.WIFI_CONNECT_FAILUREString
-
WiFi connection failed
- Since:
- 1.1.0
-
static,constantENABLE.network.WIFI_CONNECT_SUCCESSString
-
WiFi connection was successful
- Since:
- 1.1.0
Methods
-
staticENABLE.network.connectWifi(config){Object}
network.js, line 574 -
Connect to a WiFi network. Note that only one network interface is active at a time, and Ethernet has priority over WiFi.
If Ethernet is currently active, the switch to WiFi will only occur once Ethernet is disconnected.
If Ethernet is connected when this method is called, the WiFi connection will be stored but will not become active until the Ethernet connection is lost.
ReturnENABLE.status.ERRORif no wireless interface was foundName Type Description configObject Name Type Description ssidString SSID of the WiFi network
passwordString Password of the WiFi network
securityString Security protocol of the WiFi network, support for
ENABLE.network.wifi_security_type.NONE
ENABLE.network.wifi_security_type.WEP
ENABLE.network.wifi_security_type.WPA
ENABLE.network.wifi_security_type.WPA2
ENABLE.network.wifi_security_type.SAE
ENABLE.network.wifi_security_type.WPA_WPA2- Since:
- 1.1.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORor
ENABLE.status.INVALID_ARGUMENT -
staticENABLE.network.disconnect8021xNetwork(){Object}
network.js, line 696 -
Disconnect from the current connected/connecting 802.1X network
- Since:
- 1.4.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERROR -
staticENABLE.network.forgetWifi(network_id){Object}
network.js, line 599 -
Forget a WiFi network that connected previously.
network_idis returned fromENABLE.network.getConfiguredWifiNetworksName Type Description network_idNumber Network Id of the WiFi network
- Since:
- 1.1.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORor
ENABLE.status.INVALID_ARGUMENT -
staticENABLE.network.getConfiguredWifiNetworks(){Object}
network.js, line 620 -
Retrieves an array of the networks which this device previously connected to.
- Since:
- 1.1.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORresultArray.<Object> Array of object with following members: Name Type Description network_idint Network Id of the WiFi network ssidString SSID of the WiFi network passwordString Password of the WiFi network securityString The security protocol supported by the WiFi network. ENABLE.network.wifi_security_type -
staticENABLE.network.getConnectionInfo(custom_interface){Object}
network.js, line 392 -
Retrieves the details of the active network's configuration.
ENABLE.status.NOT_READYwill be returned if there is no active network
Members other than status_code will be returned whenENABLE.status.SUCCESSName Type Description custom_interfaceString optional Optional, specify which network interface to query when multiple network interfaces are connected, i.e. WiFi and ethernet
- Since:
- 1.1.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORor
ENABLE.status.NOT_READYnic_nameString Name of NIC ip_typeString ENABLE.network.TYPE_STATICorENABLE.network.TYPE_DHCPip_addressString IPv4 / IPv6 address, e.g. "10.0.35.106" or "2403:4a00:4001:15:45b7:8109:cf41:44b6" prefix_lengthNumber Prefix length of IPv4 / IPv6 address ip_address_v6_listArray.<Object> List of IPv6 Addresses Name Type Description ip_addressString IPv6 address prefix_lengthNumber Prefix length of IPv6 address flag_permanentboolean Permanent address, truefor indicating the address is permanent.falsefor indicating dynamic address (stateless address)flag_temporaryboolean Temporary address, truefor indicating the address is temporary. Temporary address is a randomly generated 64-bit number as the interface ID instead of an interface's MAC address. You can use temporary addresses for any interface on an IPv6 node that you want to keep anonymous.scopeString The scope of the area where this address is valid.
global- the address is globally valid.
site- the address is site local.
link- the address is link local.
host- the address is valid only inside this host.gatewayString IP address of default gateway dns_serversArray.<String> List of DNS's IP address bandwidthNumber Downstream bandwidth in Kbps netmaskString IPv4 Network mask of STB, e.g. "255.255.255.0". return empty string for IPv6 address. network_idint Available when connected to wireless interface. Network Id of the WiFi network. ssidString Available when connected to wireless interface. SSID of the WiFi network. signal_levelint Available when connected to wireless interface. The detected signal level in -dBm, also known as the RSSI. securityString Available when connected to wireless interface. The security protocol supported by the WiFi network. See ENABLE.network.wifi_security_type. -
staticENABLE.network.getEapStatus(){Object}
network.js, line 682 -
Retrieves the current EAP (Extensible Authentication Protocol) status for each network interface.
EAP is used within 802.1X frameworks for network access control, providing a secure method for
authenticating network devices. This function checks the authentication status of each network
interface that could be involved in such authentication processes.- Since:
- 1.3.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORresultArray.<Object> Array of object with following members: Name Type Description ifaceString Interface name (e.g., 'wlan0', 'eth0'). statusString The EAP authentication status. ENABLE.network.eap_status -
staticENABLE.network.getInterfaceInfo(){Object}
network.js, line 346 -
Retrieves details for all network interfaces on the device.
This function returns an array containing the configuration details of each network interface (NIC) present on the device.- Since:
- 1.0.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORresultArray.<Object> Array of object with following members: Name Type Description nic_nameString Name of NIC nic_typeString Type of NIC, ENABLE.network.nic_type.ETHERNETorENABLE.network.nic_type.WIFImac_addressString Mac address of the NIC link_upBoolean true if NIC is up linkingBoolean deprecated, use link_upinstead -
staticENABLE.network.getLastScanResult(){Object}
network.js, line 502 -
Retrieves the latest Wi-Fi network scanning results.
- This function does not trigger a new Wi-Fi scan.
- If no scan has been performed previously, it will return an empty array with status_code
ENABLE.status.SUCCESS.
- Since:
- 1.1.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORresultArray.<Object> Array of object with following members: Name Type Description ssidString SSID of the WiFi network signal_levelint The detected signal level in -dBm, also known as the RSSI. frequencyString The center frequency (Mhz) of the channel over which the client is communicating with the WiFi network. bssidString Mac address of the WiFi network securityString The security protocol supported by the WiFi network. ENABLE.network.wifi_security_type -
staticENABLE.network.getOfflineMode(){Object}
network.js, line 715 -
Retrieves the current status of offline mode. Offline mode dictates:
- Whether the UI waits for a network connection during system boot.
- If network settings should be launched automatically when the connection is lost.
This function returns the value set in the INI configuration file under
net.offline_mode.- Since:
- 1.4.0
- Deprecated
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORresultboolean true if the offline mode is enabled, false otherwise. -
staticENABLE.network.isOfflineModeEnabled(){Object}
network.js, line 733 -
Retrieves the current status of offline mode. Offline mode dictates:
- Whether the UI waits for a network connection during system boot.
- If network settings should be launched automatically when the connection is lost.
This function returns the value set in the INI configuration file under
net.offline_mode.- Since:
- 1.7.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORresultboolean true if the offline mode is enabled, false otherwise. -
staticENABLE.network.isWifiEnabled(){Object}
network.js, line 546 -
Retrieves the current state of Wi-Fi functionality on the device.
This function checks whether Wi-Fi is enabled, disabled, in the process of being enabled, or in the process of being disabled.
- Enabling: Wi-Fi is in the process of turning on. This might occur
when the system has received a command to enable Wi-Fi but the hardware
has not yet fully activated. - Disabling: Wi-Fi is in the process of turning off. This state indicates
that the system is in the midst of deactivating Wi-Fi functionality.
- Since:
- 1.1.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORresultboolean true if it is enabled or enabling, false if it is disabled or disabling - Enabling: Wi-Fi is in the process of turning on. This might occur
-
staticENABLE.network.remove8021xSecurityConfig(){Object}
network.js, line 662 -
Deletes the stored IEEE 802.1X Ethernet connection configuration from the device.
This operation will not immediately disconnect the device from the currently connected network.
- The current session will remain active until the device is rebooted or there's an Ethernet hot plug event.
To terminate the current network connection, useENABLE.network.disconnect8021xNetwork.
This function is particularly useful for scenarios requiring temporary connections to EAP networks.
- Since:
- 1.3.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERROR - The current session will remain active until the device is rebooted or there's an Ethernet hot plug event.
-
staticENABLE.network.set8021xSecurityConfig(config){Object}
network.js, line 642 -
Establishes a network connection using IEEE 802.1X Ethernet with the provided
config.- Upon successful authentication, the configuration is automatically saved to the device.
- Each subsequent call to this function will overwrite any previously stored configuration with the new
config. - Persistent Connection: The device will automatically connect to the network upon booting up, following a reboot, or upon an Ethernet hot plug event, ensuring seamless connectivity without manual reconfiguration.
- For temporary connections to EAP networks that should not persist after a reboot or hot plug, call
ENABLE.network.remove8021xSecurityConfigafter connecting.
Name Type Description configObject Name Type Description identityString The identity used for IEEE 802.1X connection
passwordString The password used for IEEE 802.1X connection
- Since:
- 1.3.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERROR -
staticENABLE.network.setDhcpConfig(custom_interface){Object}
network.js, line 417 -
Configures the specified network interface to use DHCP for obtaining an IP address.
If no interface name is provided, it attempts to set DHCP on current active interface.
ip_type in result ofENABLE.network.getConnectionInfowill becomeENABLE.network.TYPE_DHCPName Type Description custom_interfaceString optional Optional The name of the network interface (e.g., "eth0", "wlan0"). If omitted, DHCP will be set on the current active interface.
- Since:
- 1.1.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERROR -
staticENABLE.network.setEventCallback(callback){Object}
network.js, line 323 -
Register network callback function for JavaScript application.
Only one callback function can be registered. Passnullto unregister.
Example:let callback = function(obj) { if (obj.event === ENABLE.network.NETWORK_READY) { console.log("A network interface is ready to use"); } }; ENABLE.network.setEventCallback(callback);Name Type Description callbackENABLE.network#Callback Reference to the callback function which will be called when a network event is received.
- Since:
- 1.0.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.INVALID_ARGUMENT -
staticENABLE.network.setOfflineMode(enable){Object}
network.js, line 754 -
- Sets the offline mode status. This setting influences:
- Whether the UI waits for a network connection during system boot.
- If network settings should be launched automatically when the connection is lost.
Important Note: Calling this API takes effect only when
net.offline_modeis not set in the INI configuration.
Otherwise, the preference is stored and will be applied oncenet.offline_modeis removed.Name Type Description enableBoolean set to true in order to enable offline mode, or false to disable.
- Since:
- 1.4.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESS,
ENABLE.status.INVALID_ARGUMENT, or
ENABLE.status.ERROR -
staticENABLE.network.setStaticConfig(config, custom_interface){Object}
network.js, line 453 -
Use specified connection config on current network interface
Calling
ENABLE.network.setStaticConfigwill update result ofENABLE.network.getConnectionInfo- ip_type will become
ENABLE.network.TYPE_STATIC
Remarks:
IPv4 address will be expected in format "192.168.1.2"Sample code calling
ENABLE.network.setStaticConfig:var config = { "ip_address": "10.0.35.219", "prefix_length": 22, "gateway": "10.0.32.6", "dns_servers": [ "192.169.1.22" ] }; ENABLE.network.setStaticConfig(config);Name Type Description configObject Name Type Description ip_addressString IPv4 address of the STB
prefix_lengthNumber Network address prefix length
gatewayString IPv4 address of the gateway
dns_serversArray.<String> List of IPv4 address of DNS, expected 1 to 2 address
custom_interfaceString optional Optional, the name of the network interface (e.g., "eth0", "wlan0"). If omitted, config will be applied to current active interface.
- Since:
- 1.1.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORor
ENABLE.status.INVALID_ARGUMENT - ip_type will become
-
staticENABLE.network.setWifiEnabled(enabled){Object}
network.js, line 519 -
Switch on/off Wifi
ReturnENABLE.status.ERRORif no wireless interface was foundName Type Description enabledboolean true to enable Wifi, false to disable
- Since:
- 1.1.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORor
ENABLE.status.INVALID_ARGUMENT -
staticENABLE.network.wifiScan(){Object}
network.js, line 478 -
Scan Wifi once.
When the scan completes the registered callback function is called with the eventENABLE.network.SCAN_RESULTS_AVAILABLE. Detail of the results following the scan can be retrieved by callingENABLE.network.getLastScanResult.
If no wireless NIC is found,ENABLE.status.ERRORwill be returned.- Since:
- 1.1.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERROR
Type Definitions
-
Callback(object)
network.js, line 284 -
Callback function for
ENABLE.network.setEventCallbackName Type Description objectObject Name Type Description eventObject Possible values of event:
ENABLE.network.NETWORK_IP_CHANGED
ENABLE.network.NETWORK_INTERFACE_CHANGED
ENABLE.network.NETWORK_LINK_STATUS_UP
ENABLE.network.NETWORK_LINK_STATUS_DOWN
ENABLE.network.NETWORK_READY
ENABLE.network.SCAN_RESULTS_AVAILABLE
ENABLE.network.SCAN_FAILED
ENABLE.network.WIFI_CONNECT_SUCCESS
ENABLE.network.ETHERNET_CONNECT_SUCCESS
ENABLE.network.WIFI_CONNECT_FAILURE
ENABLE.network.ETHERNET_AUTHENTICATION_REQUEST@since 1.3.0
ENABLE.network.ETHERNET_AUTHENTICATION_SUCCESS@since 1.3.0
ENABLE.network.ETHERNET_AUTHENTICATION_FAILED@since 1.3.0- Since:
- 1.1.0