Player APIs (BrightScript & Ja...
JavaScript APIs

networkstatus

14min
the networkstatus component provides access to the current networking status of the player it provides the current state as opposed to the intended configuration for example, the current ip addresses assigned to network interfaces can be retrieved from networkstatus when the player is configured to use dhcp this component can be used to determine the actual ip addresses and other network settings that are currently active networkstatus idl \[ constructor() ] interface networkstatus { promise\<networkhoststatus> gethoststatus(); promise\<diagnosticwebserverstatus> getdiagnosticwebserverstatus(); promise\<remoteloginstatus> getremoteloginstatus(); promise\<networkinterfacestatus> getinterfacestatus(string interfacename); promise\<wifiinterfacestatus> getinterfacewifistatus(string interfacename); promise\<array\<string>> getpresentnetworkinterfaces(); promise\<array\<networkstatusroute>> getroutes(string protocol); // "ipv4" or "ipv6" }; interface networkhoststatus { attribute string hostname; attribute string mdnshostname; attribute array\<string> domainsearchpath; attribute array\<string> domainnameservers; attribute array\<string> timeservers; attribute string? proxy; attribute array\<string>? proxybypass; attribute string? crashurl; attribute string? errorurl; attribute string? recoveryurl; }; interface diagnosticwebserverstatus { attribute short? port; }; interface remoteloginstatus { attribute unsigned short? telnetport; // not present if not enabled attribute unsigned short? sshport; // not present if not enabled }; interface networkinterfacestatus { attribute string? type; attribute bool present; // interface is actually present (e g wifi may be configured but removed) attribute string presentstatus; attribute bool? haslink; attribute string? macaddress; attribute bool? isvlan; // this interface is itself a vlan attribute short? vlantag; attribute string? parentinterface; // the underlying physical interface for a vlan attribute array\<short>? vlanchildtaglist; // vlans on this interface includes zero for untagged attribute array\<networkstatusipaddress>? ipaddresslist; // includes all ipv4 and ipv6 addresses attribute long? inboundshaperrate; attribute array\<string>? domainsearchpath; attribute array\<string>? domainnameservers; }; interface networkstatusipaddress { attribute string family; // "ipv4" or "ipv6" attribute string scope; attribute string? address; // "172 30 1 30" or "fd44\ d8b8\ cab5\ cb01 19" attribute string? netmask; // ipv4 only attribute string? broadcast; // ipv4 only attribute int? prefixlength; // ipv4 and ipv6 attribute string? cidr; // address with prefix length in cidr notation }; interface wifiinterfacestatus { attribute string mode; // "ap" or "sta" attribute bool? connected; // (not present in ap mode ) attribute string? essid; attribute string? bssid; // (not present in ap mode ) attribute string? frequency; // in mhz to match other apis attribute int? signalstrength; // in dbm }; interface networkstatusroute { attribute string destination; // or "default" attribute string? source; attribute int metric; attribute array\<nexthops> nexthops; }; interface networkstatusnexthop { attribute string? gateway; attribute string? interface; } object creation to create a networkstatus component, load the @brightsign/networkstatus module using the require() method const networkstatus = require("@brightsign/networkstatus"); let networkstatus = new networkstatus(); networkstatus gethoststatus() promise\<networkhoststatus> gethoststatus() returns information about the network status of the player as a whole getdiagnosticwebserverstatus() promise\<diagnosticwebserverstatus> getdiagnosticwebserverstatus() returns information about the status of the diagnostic web server getremoteloginstatus() promise\<remoteloginstatus> getremoteloginstatus() returns information about the status of the player related to remote shell access getinterfacestatus() promise\<networkinterfacestatus> getinterfacestatus(string interfacename) returns information about the current status of the specified network interface getinterfacewifistatus() promise\<wifiinterfacestatus> getinterfacewifistatus(string interfacename) returns information about the current wifi status of the specified wireless network interface getpresentnetworkinterfaces() promise\<array\<string>> getpresentnetworkinterfaces() returns an array containing the names of all the external network interfaces present on the player does not include the loopback interface getroutes() promise\<array\<networkstatusroute>> getroutes(string protocol); // "ipv4" or "ipv6" returns an array of the current network routes for the specified protocol networkhoststatus hostname string string the player's current host name mdnshostname string string the player's current multicast dns host name this will usually be the player's host name with " local" on the end, but can differ if there are conflicts on the local network domainsearchpath array\<string> array\<string> a list of suffices that will be applied to unqualified domain names when looking them up in dns this is the combination of the search paths for all active network interfaces domainnameservers array\<string> array\<string> a list of the current dns servers that will be consulted when performing name look ups this is the combination of all the dns servers for all active network interfaces timeservers array\<string> array\<string> a list of the current time servers that will be used to set the player's clock currently this will contain either zero or one entry, but it may contain more in the future proxy string string optional optional the currently active network proxy server, if any proxybypass array\<string> array\<string> optional optional a list of host name suffices for which the proxy will be bypassed (ip addresses cannot be used) crashurl string string optional optional the url to which player crash dumps will be posted, if any errorurl string string optional optional the url to which brightscript errors will be posted, if any recoveryurl string string optional optional the url which will be consulted to determine whether the player should enter recovery, if any diagnosticwebserverstatus port short short optional optional the port number that the web server will be run on if the web server is disabled then this attribute will not be present remoteloginstatus telnetport unsigned short unsigned short optional optional the port number that the player will listen to telnet connections on if telnet is not enabled then this attribute will not be present sshport unsigned short unsigned short optional optional the port number that the player will listen for secure shell connections on if ssh is not enabled then this attribute will not be present networkinterfacestatus type string string optional optional if the interface is present, this attribute will contain "wired", "wifi", "dialup" or "unknown" note that some usb network devices may appear to the brightsign player to be of one type when they are actually a different type for example, some broadband modems appear as "wired" ethernet devices present bool bool whether the specified network interface is currently present on the player presentstatus string string provides extra human readable information explaining why the interface is not present for example, a vlan interface may not have been enabled on its corresponding physical interface haslink bool bool optional optional indicates whether the network interface currently has link macaddress string string optional optional contains the hardware mac address for network interfaces that have one isvlan bool bool optional optional indicates whether this network interface is a vlan on another lower network interface vlantag short short optional optional if this interface is a vlan, this attribute contains the tag value that will be used on the lower interface parentinterface string string optional optional if this interface is a vlan, this attribute contains the name of the lower interface that packets will be sent on vlanchildtaglist array\<short> array\<short> optional optional if this network interface has vlan interfaces running above it then this array contains all of their tag values the special tag value of zero indicates that this interface is also used itself untagged ipaddresslist array\<networkstatusipaddress> array\<networkstatusipaddress> optional optional a list of all ipv4 and ipv6 addresses assigned to this network interface inboundshaperrate long long optional optional if an inbound bandwidth shaper is enabled for this interface, this attribute contains the rate in bits per second domainsearchpath array\<string> array\<string> optional optional a list of suffices that this network interface contributes to the host configuration when this network interface is active see networkhoststatus domainnameservers array\<string> array\<string> optional optional a list of dns servers that this network interface contributes to the host configuration when this network interface is active see networkhoststatus networkstatusipaddress family string string contains the address family "ipv4" or "ipv6" scope string string mainly useful for ipv6 addresses, this attribute indicates the scope of the address possible values are "global", "site", "link", "host" and "nowhere" address string string optional optional the actual address as a string netmask string string optional optional for ipv4 addresses only this attribute contains the prefix length expressed as a traditional netmask broadcast string string optional optional for ipv4 addresses only this attribute contains the network broadcast address prefixlength int int optional optional for ipv4 and ipv6 addresses this attribute contains the number of bits of the address that are used to identify the network cidr string string optional optional for ipv4 and ipv6 addresses this attribute contains the address and prefix length in classless inter domain routing (cidr) syntax address/prefix wifiinterfacestatus mode string string indicates which mode the wifi interface is currently in when in "ap" mode the interface is acting as a wireless access point for other wireless devices to connect to in "sta" mode the interface is acting as a client to another wireless access point connected bool bool optional optional if the interface is in "sta" mode, indicates whether the interface is connected to an access point in "ap" mode this attribute is not present essid string string optional optional if the interface is in "sta" mode, indicates the essid of the ap that the interface is connected to in "ap" mode, indicates the essid that the wireless interface is advertising for clients to connect to bssid string string optional optional if the interface is in "sta" mode, indicates the bssid of the ap that the interface is connected to in "ap" mode this attribute is not present frequency string string optional optional the frequency that the wireless interface radio is currently using, in mhz signalstrength int int optional optional the current signal strength, in dbm networkstatusroute destination string string the route destination or "default" for the default route metric int int the priority for the route lower priority routes are preferred nexthops array\<nexthops> array\<nexthops> a list of where packets subject to this route will be sent next this list currently contains only one element networkstatusnexthop gateway string string optional optional the address to which packets will be sent interface string string optional optional the network interface on which packets will be sent