ptp
ptp allows you to retrieve information about the network PTP state of the player.
ptp IDL
interface PtpEvent {
attribute String type;
};
callback PtpEventCallback = void (PtpEvent event);
interface Ptp {
Promise<PtpStatus> getStatus();
void addEventListener(String type, PtpEventCallback callback);
void removeEventListener(String type, PtpEventCallback callback);
};
interface PtpStatus {
attribute long timestamp;
attribute String state;
};
Object Creation
To create a ptp object, load the @brightsign/ptp module using the require()
method.Â
var ptpclass = require('@brightsign/ptp');
var ptp = new ptpclass();
Ptp
getStatus()
Promise<PtpStatus> getStatus()
Gets the status of a PTPÂ network for a player.
PtpEvent
This event object is generated by the roPtp object whenever the PTP status of the player changes.
type
 string: The name of the event ( which will always be PtpEvent).
PtpStatus
timestamp
long:  The number of seconds since the PTP state was last changed. This value can be compared against the total uptime of the player, which is retrieved by callingUpTime(0)
.state
string: Indicates the current PTP state of the player.  Values can be Master, Slave, or Uncalibrated.
Example
As of BrightSignOS 8.3.20, to get the current data set:Â
This will return a promise that, when successful, resolves to type:Â