The networkconfiguration object allows for configuration of the network interfaces on the player. Each object instance corresponds to a single network interface (Ethernet, WiFi, or modem), which is specified using the
This object only allows you to configure/retrieve settings related to the network interfaces on the device. For other network information, use the Node.js OS module.
To create a networkconfiguration object, first load the
brightsign/networkconfiguration module using the
Require() method. Then create an instance of the networkconfiguration class using a string value that indicates the network interface associated with the instance.
Use this interface to configure a network interface on the player.
[DOMString] type: The network interface type, which can be
"modem". Use this attribute to specify which network interface the object instance will configure.
Returns an empty NetworkInterfaceConfig object. Passing this object to
applyConfig() will reset all network settings on the associated interface to default.
Returns configuration settings for the network interface. Depending on the specified
type, this method will return an
Configures the network interface using the parameters in the passed NetworkInterfaceConfig object. This method returns void upon success.
To reset a network-interface setting to its default value, pass the NetworkInterfaceConfig object without the corresponding attribute.
Returns LLDP information related to the network. This method is available with the Ethernet interface only.
Enables or disables the Ethernet activity LED (i.e. flashing during link and activity behavior). The Ethernet LED is enabled by default. Changes to this setting do not persist across reboots. This method is available with the Ethernet interface only.
Scans for WiFi access points are returns a list of detected access points. This method is available with the WiFi interface only.
This interface contains settings related to a network interface.
[long] metric: The routing metric for the default gateway on the interface. Routes with lower metrics are preferred over routes with higher metrics.
[DHCPServerConfig] dhcpServerConfig: A DHCPServerConfig interface that specifies the DHCP server configuration on the wireless access point (which is disabled by default). The DHCP server can be disabled by setting this attribute to a null value when calling
[DOMStringList] dnsServerList: A string list containing a maximum of three DNS servers. Each string should contain the dotted-quad IP address of a DNS server.
[IPAddressList] ipAddressList: An IPAddressList object containing the static IP address(es) for the network interface. Players currently do not support multiple IPv4 addresses. If the IP address is assigned via DHCP, this attribute will be empty. In this case, use the Node.js os module to obtain the IP address.
[long] inboundShaperRate: The bandwidth limit for inbound traffic in bits per second. A value of -1 specifies the default bandwidth limit, and a value of 0 specifies no bandwidth limit (these two settings are functionally the same).
Because of overhead on the shaping algorithm, attempting to limit the bandwidth at rates greater than approximately 2Mbit/s will reduce speeds to less than the specified rate.
[long] mtu: The maximum transmission unit (MTU) for the network interface in bytes
[DOMIntegerList] vlanIdList: A list of VLAN IDs that are supported on the parent network interface (i.e.
[DOMString] clientIdentifier: The DHCP client identifier for the network interface
[DOMString] domain: The domain name for the network interface
This interface contains attributes related to the WiFi interface:
[DOMString] essId: The ESSID of the wireless network
[DOMString] passphrase: The plain-text passphrase/key for the wireless network
[DOMString] obfuscatedPassphrase: The passphrase/key for the wireless network that has been obfuscated using a shared secret
Contact firstname.lastname@example.org to learn more about generating a key for obfuscation and storing it on the player.
[bool] accessPointMode: A Boolean flag specifying whether WiFi access-point mode is enabled or disabled. The ESSID and passphrase of the WiFi access point is set with the
obfuscatedPassphraseattributes. If a passphrase has been set, the wireless access point will use WPA2 authentication–otherwise, it will use no authentication.
[long] accessPointFrequency: The frequency of the WiFi access point (in MHz)
The following attributes relate to WPA Enterprise support:
[DOMString] identity: The RADIUS identity. If this value is blank, it will be taken from the specified client certificate ("subjectAltName" will be used if present; otherwise, the "commonName" is used).
[DOMString] eapTlsOptions: A string that contains EAP-specific options. Currently, this string can be used to enable or disable MD5 support ("md5=enable" or "md5=disable").
[DOMString] caCertificates: The contents of a CA certificate file in text form (i.e. a "pem" file). Certificates can also be sent from an EAP peer.
[DOMString] clientCertificate: The contents of a client certificate in text form (i.e. a "pem" file)
[DOMString] privateKey: The private key for authentication. If the private key is password protected, use the
obfuscatedPassphraseattribute to set the password.
If the client certificate and associated private key are in the same PKCS#12 file, the file contents should be specified in the
privateKeyfield and the
clientCertificatefield should be left blank.
This interface contains attributes related to the modem interface:
This interface represents the results of a scan for wireless networks. Each entry in the list contains the following parameters:
[DOMString] essID: The network name
[DOMString] bssID: The BSSID of the Access Point
[long] signal: The received signal strength. The absolute value of this attribute is usually not relevant, but it can be compared with the reported value on other networks or in different locations.
This interface contains settings related to the DHCP server on the WiFi access point. This interface is only applicable if the player is using WiFi access-point mode.
[DOMString] start: The beginning of the range of offered IP addresses
[DOMString] end: The end of the range of offered IP addresses
This interface represents an IP address configuration.
[DOMString] family: The IP configuration (
[DOMString] address: The IP address
[DOMString] netmask: The netmask
[DOMString] gateway: The gateway
[DOMString] broadcast: The broadcast address
This interface contains location information received from the network infrastructure using the LLDP-MED protocol.
The following code switches from a manual IP setting to the default DHCP configuration by retrieving the current NetworkInterfaceConfig object, deleting the
ipAdressList attribute, and passing the object back into the system: