Device

This object serves as a collection of APIs for accessing peripheral devices such as the Dolby Conference Phone.

Example:

dapi.device.phone.reboot();

Member Summary

Public Members

Flag that indicates whether the system idling mode has been disabled.

Returns the status of the most recent request to upload logs.

Property that contains device certificate in PEM format.

Provides access to a DevicePhone object which holds APIs related to a paired Dolby Conference Phone.

Flag that indicates whether the system sleep mode has been disabled.

Flag that indicates whether the system wake event has been disabled and cannot automatically exit sleep mode.

Method Summary

Public Methods

decrypt(data: string, callback: function(plain_data: string))

Decrypt data, encoded with certificate.

Allows being notified of when the status of the most recent logs-upload request has changed.

Instructs the system to make itself the active input to the TV.

Sets the system name that should appear as the input to the TV.

sign(data: string, digest: string, callback: function(signature: string))

Sign data with private key.

sleep()

Instructs the system to turn off the TV.

uploadLogs(url: string, type: string)

Starts uploading the device's logs.

Starts uploading the device's logs to the Dolby diagnostic website, useful for reporting problems to Dolby.

Check Device.Status.DiagnosticsUpload configuration parameter for the status of the last request.

wake()

Instructs the system to exit sleep mode (i.e., wake) and turn on the TV.

Public Members

public idleTimeoutDisabled: boolean source

Flag that indicates whether the system idling mode has been disabled. The system enters idle state when there is no user interaction such as:

  • on a call or conference
  • setting up system
  • receiving a call

When the system has been in idle mode for the user-preferred timeout, then the system will enter its sleep mode.

Possible values are:

  • true: The system will never get into idle state.
  • false: The system will get into idle state when all the conditions are met

public lastLogsUploadStatus: string source

Returns the status of the most recent request to upload logs.

Possible values are:

  • "IN_PROGRESS": Waiting for the logs-upload to finish.
  • "SUCCESS": The request finished successfully.
  • "FAILED": The request failed to complete.

public localCertificate: string source

Property that contains device certificate in PEM format.

public phone: Phone source

Provides access to a DevicePhone object which holds APIs related to a paired Dolby Conference Phone.

public systemSleepDisabled: boolean source

Flag that indicates whether the system sleep mode has been disabled.

Possible values are:

  • true: The system will never automatically go into sleep mode. The app is responsible for placing the system in sleep mode.
  • false: The system will automatically go into sleep mode after the timeout has expired. There are two different timeouts; one for regular working hours and one for after hours.

public systemWakeDisabled: boolean source

Flag that indicates whether the system wake event has been disabled and cannot automatically exit sleep mode.

Possible values are:

  • true: The system will never automatically wake. The app is responsible for waking the system from sleep mode.
  • false: The system will wake when the conditions for idling are no longer met.

Public Methods

public decrypt(data: string, callback: function(plain_data: string)) source

Decrypt data, encoded with certificate. This is an asynchronous operation.

Params:

NameTypeAttributeDescription
data string

Base64 encoded string of data to be decrypted

callback function(plain_data: string)

The callback function with decrypted data (Base64 encoded) as argument.

Example:

// Decrypt is always asynchronous
dapi.device.decrypt(data, function(base64_data) {
 console.log("Decrypted data: " + base64_data);
});
dapi.device.decrypt("x/9YL3feVzgCE6kD8saWiZVO/Tzj5Pbah7RX4bc0iry6C5yCimsVTdg9NAs65HVQafK9q2IfrgNyJcuPZECihThg3KZiMSVOR5wzhv05AwoRygtZQBaEXNDDpWePb6G+bGVToj5P23KJSlUqGXA7ud8bYWm/7NK35DvP93xKc09w1P8s+AurSNMerAgmQbBizMtOe82EF62vNh6qGKspn5Wwti7yemTACDkEprm2dZ8ClgkgsJnteBH0osj1lDc3YtNlmWDSglImxjt5bFVsq3t62qIA27dT4bDablSY5fZaGO+Z0502PvsnxzUb1qGq0wpA9+7ysZOqYbTD5lo7fQ==", function(base64_data) {
     console.log("Decrypted data (base64): " + base64_data);
     console.log("Decrypted data: " + atob(base64_data));
});

public lastLogsUploadStatusChanged(newStatus: string) source

Allows being notified of when the status of the most recent logs-upload request has changed.

Params:

NameTypeAttributeDescription
newStatus string

the new state of the logs-upload request.

  • "IN_PROGRESS": Waiting for the logs-upload to finish.
  • "SUCCESS": The request finished successfully.
  • "FAILED": The request failed to complete.

Example:

dapi.device.lastLogsUploadStatusChanged.connect(myLogsStatusHandlerFunction);

public setActiveDisplayInput() source

Instructs the system to make itself the active input to the TV.

The connected TV/monitor needs to support CEC (Consumer Electronics Control) functionality.

public setOsdName(name: string) source

Sets the system name that should appear as the input to the TV.

Params:

NameTypeAttributeDescription
name string

The name that should appear on the OSD (On Screen Display) when referring to the Dolby Voice Room system.

The connected TV/monitor needs to support CEC (Consumer Electronics Control) functionality.

public sign(data: string, digest: string, callback: function(signature: string)) source

Sign data with private key. Certificate can be used to validate signature This is an asynchronous operation.

Params:

NameTypeAttributeDescription
data string

Base64 encoded string of data to be signed

digest string

Digest name that is supposed to be used for signing. E.g. "md5", "sha1", "sha256".

callback function(signature: string)

The callback function with Base64 encoded signature passed as argument.

Example:

// Sign is always asynchronous
dapi.device.sign(btoa("test"), "sha256", function(base64_text){console.log("base64 signature: " + base64_text);})
or
dapi.device.sign("dGVzdA==", "sha256", function(base64_text){console.log("base64 signature: " + base64_text);})

Both commands would output:
plain text: QcdZNMVKDSgtm9u6MTnHRT76QF7A7G3G8ffQ/fW6oYkagdJfUGG2Ifn/PenzqhIsGdiFBKkmSAqew0P3E9K8JhA4YvxGcDoCkJm7srU/tQvqaP0r0/gJJPIWP4fs936Mq22WXFV9pnWrfPHJgBBqzsJBjxtqkdbM4q+UNllUVrciJq5W0Q4yaXc7PFwc4au56FAh47sG9yNg/hfVRrHoYGwSwLXv63PWgy3atopkZUAZ36iE9nuzq8lTnc2yVN+6OiiPej49zNjgI/axfheM3GrCfvCVPlUviuJLkISp978U3bSnVnIbeTQlIsdjO0D4MkJlpDPfMkWvvBUdRt1Ltw==
// Sign is always asynchronous
// And we are using MD5 instead of sha256 digest for signature.
dapi.device.sign(btoa("test"), "md5", function(signature) {
 console.log("Base64 signature with MD5: " + signature);
});

For manual validation:
Store signature in binary
$ echo \
QcdZNMVKDSgtm9u6MTnHRT76QF7A7G3G8ffQ/fW6oYkagdJfUGG2Ifn/PenzqhIs\
GdiFBKkmSAqew0P3E9K8JhA4YvxGcDoCkJm7srU/tQvqaP0r0/gJJPIWP4fs936M\
q22WXFV9pnWrfPHJgBBqzsJBjxtqkdbM4q+UNllUVrciJq5W0Q4yaXc7PFwc4au5\
6FAh47sG9yNg/hfVRrHoYGwSwLXv63PWgy3atopkZUAZ36iE9nuzq8lTnc2yVN+6\
OiiPej49zNjgI/axfheM3GrCfvCVPlUviuJLkISp978U3bSnVnIbeTQlIsdjO0D4\
MkJlpDPfMkWvvBUdRt1Ltw== | openssl enc -base64 -d > sign.sha256

Verify signature
$ echo -n test | openssl dgst -verify pubkey.pem -signature sign.sha256
Verified OK

public sleep() source

Instructs the system to turn off the TV.

The connected TV/monitor needs to support CEC (Consumer Electronics Control) functionality.

public uploadLogs(url: string, type: string) source

Starts uploading the device's logs.

Params:

NameTypeAttributeDescription
url string

target address where the logs will be uploaded to

type string

specifies the kind of logs to upload:

  • "FULL": Upload maximum log information.
  • "EVENTS_ONLY": Only upload text log events.
  • "CALL_STATS": Upload call statistics.

Example:

dapi.device.uploadLogs("http://mywebserver.net/myupload", "FULL");

public uploadLogsToDolby() source

Starts uploading the device's logs to the Dolby diagnostic website, useful for reporting problems to Dolby.

Check Device.Status.DiagnosticsUpload configuration parameter for the status of the last request.

Example:

dapi.device.uploadLogsToDolby();
...
console.log("Status of upload to Dolby: " + 
  dapi.configuration.parameter(ConfigConstants.CFG_DEVICE_STATUS_DIAGNOSTICSUPLOAD).value);

Possible values for the configuration parameter are:
 - "IN_PROGRESS": Waiting for the logs-upload to finish.
 - "SUCCESS": The request finished successfully.
 - "FAILED": The request failed to complete.

public wake() source

Instructs the system to exit sleep mode (i.e., wake) and turn on the TV.

The connected TV/monitor needs to support CEC (Consumer Electronics Control) functionality.