To create a networkdiagnostics object, first load the brightsign/networkdiagnostics
module using the require()
method. Then create an instance of the networkdiagnostics class.
var NetworkDiagnosticsClass = require("@brightsign/networkdiagnostics"); var networkDiag = new NetworkDiagnosticsClass(); |
Use this interface to retrieve diagnostic information.
Important The testInternetConnectivity() method generates a large amount of network traffic (e.g. DNS lookups) that may degrade the performance of a player, create network congestion, or be perceived as abusive by the network's upstream DNS provider. This method is intended for one-time use to validate network connectivity or to diagnose a suspected problem. |
Promise<InterfaceTestResult> testInternetConnectivity() |
Performs various tests on the Internet connection (via any available network interface) to determine whether it appears to be working correctly. This method returns an InterfaceTestResult
interface when diagnostics are complete.
Promise<InterfaceTestResult> testNetworkInterface(String interface_name) |
Performs tests on the specified network interface to determine whether it appears to be working correctly. Interface name values are the same as those used with the roNetworkConfiguration object. This method returns an InterfaceTestResult
interface when diagnostics are complete.
Promise<PingResult> ping(String host_name, PingConfig config) |
Pings a device with the specified host_name
to determine if there are connection issues.
Promise<InterfaceTestResult> traceroute(String host_name, TraceRouteConfig config) |
For BrightSign internal use. Behavior subject to change without notice. Performs a standard traceroute diagnostic on the specified host_name
.
This interface contains diagnostic results:
diagnosis
String: A single-line diagnosis of the first problem identified with the network interface or Internet connection
ok
bool: A Boolean flag indicating whether the network interface or Internet connection passed diagnostic tests
log
Log: A Log object containing diagnostic information related to the network interface or Internet connection
This interface contains a list of diagnostic logs. Each log contains the following attributes:
name
: String: A description of the diagnostic
pass
bool: A Boolean flag indicating whether the diagnostic was successful
result
String: A description of the diagnostic result
info
StringList: A string list containing diagnostic data
This interface is not recommended unless you are using BrightSign OS v8.3.45 and later.
count
unsigned short: The default value is 10.
interval
unsigned long: The interval value in milliseconds. The default is 100.
timeout
unsigned long: The timeout value in seconds. The default is 10000.
packetsize
unsigned long: The packet size in bytes. The default is 56.
ipv4
bool: Enable pinging IPv4 addresses. The default is true
.
ipv6
bool: Enable pinging IPv6 addresses. The default is true
.
allAddresses
bool: If true
then ping all addresses returned from the DNS query. If false,
then each will be pinged in turn until one responds. The default is false
.
This interface is not recommended unless you are using BrightSign OS v8.3.45 and later.
hostname
String: The host name or literal address pinged.
results
PingResults:
This interface is not recommended unless you are using BrightSign OS v8.3.45 and later.
up
bool: This value is true
if at least one address responded to at least 50% of the echo requests.
ipv4
Array<ProtocolPingResult>:
ipv6
Array<ProtocolPingResult>:
This interface is not recommended unless you are using BrightSign OS v8.3.45 and later.
address
string: The IP address pinged
up
bool: If true,
the address responded to at least 50% of the echo requests
report
ProtocolPingReport:
This interface is not recommended unless you are using BrightSign OS v8.3.45 and later.
transmitted
unsigned short: The number of echo requests sent
received
unsigned short: The number of echo replies received
stats
ProtocolPingStats:
This interface is not recommended unless you are using BrightSign OS v8.3.45 and later.
quickest
unsigned long: The quickest reply received
average
unsigned long: The average time across all replies from address
slowest
unsigned long: The slowest reply received
units
string: The value is always "us", to indicate microseconds
The following script creates a networkdiagnostics instance and logs Internet diagnostic data to the console:
var NetworkDiagnosticsClass = require("@brightsign/networkdiagnostics"); var nd = new NetworkDiagnosticsClass(); nd.testInternetConnectivity().then( function(data) { console.log(JSON.stringify(data)); }) .catch( function(data) { console.log(JSON.stringify(data)); }); |