Page tree
Skip to end of metadata
Go to start of metadata

ON THIS PAGE

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 type attribute.

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.

networkconfiguration IDL
[
    GarbageCollected
    Constructor(DOMString ifName)
] interface NetworkInterface {
    attribute DOMString type; // values: wifi, ethernet, modem
    NetworkInterfaceConfig defaultConfig();
    Promise <dynamic> getConfig(); // Promise will be resolved as WifiInterfaceConfig, ModemInterfaceConfig, EthernetInterfaceConfig
    Promise <void> applyConfig(NetworkInterfaceConfig config);
    [type == "ethernet"] Promise <LLDPNeighborInformation> getNeighborInformation();
    [type == "ethernet"] Promise <void> enableLeds();
    [type == "wifi"] Promise <WifiAccessPointList> scan();
};

interface WifiAccessPointList {
    attribute DOMString essId;
    attribute DOMString bssId;
    attribute long signal;
};

interface LLDPNeighborInformation {
    // Information is directly converted from LLDP.
};

interface NetworkInterfaceConfig {
    attribute long metric;
    [optional = CONFIG_DHCP_SERVER] attribute DHCPServerConfig dhcpServerConfig;
    attribute DOMStringList dnsServerList;
    attribute IPAddressList ipAddressList;
    attribute long inboundShaperRate;
    attribute long mtu;
    [optional = CONFIG_VLAN] attribute DOMIntegerList vlanIdList;
    attribute DOMString clientIdentifier;
    attribute DOMString domain;
};

[optional = CONFIG_DIALUP] interface DialUpInterfaceConfig : public NetworkInterfaceConfig {
    attribute DOMString user;
    attribute DOMString password;
    attribute DOMString number;
    attribute DOMString initString;
};

interface DHCPServerConfig {
    attribute DOMString start;
    attribute DOMString end;
};

interface IPAddress {
    attribute DOMString family;
    attribute DOMString address;
    attribute DOMString netmask;
	attribute DOMString gateway;
	attribute DOMString broadcast;
};

interface EthernetInterfaceConfig : public NetworkInterfaceConfig {
    attribute DOMString securityMode;
    attribute DOMString identity;
    attribute DOMString eapTlsOptions;
    attribute DOMString caCertificates;
    attribute DOMString clientCertificate;
    attribute DOMString privateKey;
};

interface WifiInterfaceConfig : public NetworkInterfaceConfig{
    attribute DOMString essId;
    attribute DOMString passphrase;
    attribute DOMString obfuscatedPassphrase;
    attribute DOMString country;
    attribute DOMString securityMode;
    attribute DOMString identity;
    attribute DOMString eapTlsOptions;
    attribute DOMString caCertificates;
    attribute DOMString clientCertificate;
    attribute DOMString privateKey;
    [optional = CONFIG_WIFI_AP] attribute bool accessPointMode;
    [optional = CONFIG_WIFI_AP] attribute long accessPointFrequency;
};

Object Creation

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.

var NetworkConfigClass = require("@brightsign/networkconfiguration");
var networkConfigEth = new NetworkConfigClass("ethernet");     

NetworkInterface

Use this interface to configure a network interface on the player. 

Attributes

  • [DOMString] type: The network interface type, which can be "ethernet""wifi", or "modem". Use this attribute to specify which network interface the object instance will configure.

Methods

defaultConfig()
NetworkInterfaceConfig defaultConfig()

Returns the default configuration values for the network interface. Passing these values to applyConfig() will clear current settings.

getConfig()
Promise <Dynamic> getConfig()

Returns configuration information about the network interface. Depending on the specified type, this method will return an EthernetInterfaceConfigWiFiInterfaceConfig, or ModemInterfaceConfig interface.

applyConfig()
Promise <void> applyConfig(NetworkInterfaceConfig config)

Configures the network interface using the parameters in the passed NetworkInterfaceConfig object. This method returns void upon success.

getNeighborInformation()
Promise <LLDPNeighborInformation> getNeighborInformation()

Returns LLDP information related to the network. This method is available with the Ethernet interface only.

enableLeds()
Promise <void> enableLeds()

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.

scan()
Promise <WifiAccessPointList> scan()

Scans for WiFi access points are returns a list of detected access points. This method is available with the WiFi interface only.

NetworkInterfaceConfig

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 applyConfig().
  • [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).

    Note

    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. "ethernet""wifi", or "modem")
  • [DOMString] clientIdentifier: The DHCP client identifier for the network interface
  • [DOMString] domain: The domain name for the network interface

WiFiInterfaceConfig

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

    Note

    Contact  support@brightsign.biz  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 essId and passphrase/obfuscatedPassphrase attributes. 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 passphrase/obfuscatedPassphrase attribute to set the password.

    Note

     If the client certificate and associated private key are in the same PKCS#12 file, the file contents should be specified in the privateKey field and the clientCertificate field should be left blank.

  • [DOMString] securityMode
  • [DOMString] country

DialUpInterfaceConfig

This interface contains attributes related to the modem interface:

  • [DOMString] user
  • [DOMString] password
  • [DOMString] number
  • [DOMString] initString

WifiAccessPointList

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.

DHCPServerConfig

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

IPAddress

This interface represents an IP address configuration.

  • [DOMString] family: The IP configuration ("IPv4" or "IPv6").
  • [DOMString] address: The IP address
  • [DOMString] netmask: The netmask
  • [DOMString] gateway: The gateway
  • [DOMString] broadcast: The broadcast address

LLDPNeighborInformation

This interface contains location information received from the network infrastructure using the LLDP-MED protocol.

Example

var networkConfigClass = require("@brightsign/networkconfiguration");
var nc = new networkConfigClass("Ethernet");

nc.getConfig().then(
        function(data) {
            console.log("***General Interface Data***");
            console.log(JSON.stringify(data));
        })
    .catch(
        function(data) {
            console.log(JSON.stringify(data));
        });

defConfig = nc.defaultConfig();
console.log("***Default Interface Data***");
console.log(JSON.stringify(defConfig));
  • No labels

1 Comment

  1. This requires some information about resetting the settings to default, and changing a single setting.

    defaultConfig() returns an empty object. Resetting the network interface settings can be achieved by:

    nc.applyConfig({});

    or 

    nc.applyConfig(nc.defaultConfig();

    If user wants to set an individual field to default, he/she should read back the current settings, delete the field from the settings and write it back. If a setting doesn't exist in written configuration, it is set to default.

    Example shows how to switch back to dynamic IP, if a static ip address is set:

    nc.getConfig().then(
            function(data) {

                           delete data.ipAddressList;

                           return nc.applyConfig(data);

            })
        .then(
            function(data) {
                console.log("Changes succesfully applied");
            }).catch(function(data)

                   { console.log("Operation failed")});