Configuration

This object consists of a set of APIs that can be used to manage the Dolby Voice Hub configuration. These include get, set, reset, and notify methods. Also see ConfigurationParameter object for accessing properties for each parameter.

See Hub configuration parameters for a list of the Dolby Voice Hub configuration parameters which can be accessed using these APIs. Also, you can get configuration parameters related constants for your code here: Hub configuration constants

Member Summary

Public Members

List of available parameters.

Method Summary

Public Methods

Factory reset the Dolby Voice Hub.

Get access to a ConfigurationParameter object for the given parameter.

Start provisioning the Dolby Voice Hub using the current provisioning server configurations.

Reboot the Dolby Voice Hub.

resetParameter(parameterName: string, callback: function(ret: number))

Reset one parameter to its default value.

resetParameters(parameterNameArray: Array<string>, callback: function(ret: number))

Reset multiple parameters to their default values.

setParameter(parameterName: string, value: string | boolean | number, callback: function(ret: number))

Set one parameter to a value.

setParameters(parameterNameValueMap: Map<string, string|boolean|number>, callback: function(ret: number))

Set multiple parameters using a name-value map.

Public Members

public parameterList: Array<string> source

List of available parameters.

Public Methods

public factoryResetDevice() source

Factory reset the Dolby Voice Hub. This will cause the Dolby Voice Hub to reboot and return to the Out-of-Box state. @example: dapi.configuration.factoryResetDevice();

public parameter(parameterName: string): ConfigurationParameter source

Get access to a ConfigurationParameter object for the given parameter. This object can used to get further information about the parameter.

1) Gets access to parameter object:

dapi.configuration.parameter(parameterName)

2) Reads the parameter's value:

dapi.configuration.parameter(parameterName).value

3) Indicates whether the parameter is changeable (true/false):

dapi.configuration.parameter(parameterName).changeable

4) Indicates whether changing the parameter value requires a subsequent Dolby Voice Hub reboot (true/false):

dapi.configuration.parameter(parameterName).rebootOnChange

Params:

NameTypeAttributeDescription
parameterName string

the parameter name

Return:

ConfigurationParameter

the parameter object

Example:

// This shows the synchronous get APIs for all parameter properties
console.log("Test Get - " + ConfigConstants.CFG_PREFERENCES_RINGERVOLUME + " : " +
       dapi.configuration.parameter(ConfigConstants.CFG_PREFERENCES_RINGERVOLUME).value + ", changeable : " +
       dapi.configuration.parameter(ConfigConstants.CFG_PREFERENCES_RINGERVOLUME).changeable +  ", rebootOnChange : " +
       dapi.configuration.parameter(ConfigConstants.CFG_PREFERENCES_RINGERVOLUME).rebootOnChange);

public provision() source

Start provisioning the Dolby Voice Hub using the current provisioning server configurations. If the provisioning server contains configuration changes that cause the Dolby Voice Hub to reboot or upgrade, the Dolby Voice Hub will then reboot or go through the software upgrade process. @example: dapi.configuration.provision();

public rebootDevice() source

Reboot the Dolby Voice Hub. The Dolby Voice Hub will go through a full reboot cycle which can take about 60 seconds. @example: dapi.configuration.rebootDevice();

public resetParameter(parameterName: string, callback: function(ret: number)) source

Reset one parameter to its default value. This is an asynchronous operation. The callback function has a 'ret' value for the operation.

Params:

NameTypeAttributeDescription
parameterName string

The parameter name to reset

callback function(ret: number)

The callback function

Example:

// Set is always asynchronous
dapi.configuration.resetParameter("Preferences.RingerVolume", function(ret) {
    var status;
    switch (ret) {
       case 0: status = "OK"; break;
       case -1: status = "ErrorNotFound"; break;
       case -2: status = "ErrorNotWritable"; break;
       case -3: status = "ErrorInvalidValue"; break;
       case -4: status = "ErrorGeneric"; break;
       default: status = "ErrorUndefined"; break;
    }
    console.log("Reset value for Preferences.RingerVolume, status: " + status);
});

public resetParameters(parameterNameArray: Array<string>, callback: function(ret: number)) source

Reset multiple parameters to their default values. This is an asynchronous operation. The callback function has a 'ret' value for the operation.

Params:

NameTypeAttributeDescription
parameterNameArray Array<string>

Array of parameter names to reset

callback function(ret: number)

The callback function

Example:

var resetParamsList = ["Preferences.DndEnabled", "Preferences.SpeechVolume", "Dvms.Service.Name"];
// reset multiple parameters API, asynchronously
dapi.configuration.resetParameters(resetParamsList, function(ret) {
     var status;
   switch (ret) {
      case 0: status = "OK"; break;
      case -1: status = "ErrorNotFound"; break;
      case -2: status = "ErrorNotWritable"; break;
      case -3: status = "ErrorInvalidValue"; break;
      case -4: status = "ErrorGeneric"; break;
      default: status = "ErrorUndefined"; break;
   }
  console.log("Reset multiple - " + resetParamsList + ", status: " + status);
});

public setParameter(parameterName: string, value: string | boolean | number, callback: function(ret: number)) source

Set one parameter to a value. This is an asynchronous operation.

Params:

NameTypeAttributeDescription
parameterName string

The parameter name

value string | boolean | number

The value to set

callback function(ret: number)

The callback function

Example:

// Set is always asynchronous
dapi.configuration.setParameter(ConfigConstants.CFG_PREFERENCES_RINGERVOLUME, parseInt('6'), function(ret) {
 var status;
   switch (ret) {
   case 0: status = "OK"; break;
   case -1: status = "ErrorNotFound"; break;
   case -2: status = "ErrorNotWritable"; break;
   case -3: status = "ErrorInvalidValue"; break;
   case -4: status = "ErrorGeneric"; break;
   default: status = "ErrorUndefined"; break;
 }
 console.log("Updated - " + ConfigConstants.CFG_PREFERENCES_RINGERVOLUME + ", status: " + status);
});

public setParameters(parameterNameValueMap: Map<string, string|boolean|number>, callback: function(ret: number)) source

Set multiple parameters using a name-value map. This is an asynchronous operation.

Params:

NameTypeAttributeDescription
parameterNameValueMap Map<string, string|boolean|number>

The value to set

callback function(ret: number)

The callback function

Example:

var params = {};
params[ConfigConstants.CFG_PREFERENCES_SPEECHVOLUME]= parseInt('2');
params[ConfigConstants.CFG_PREFERENCES_DNDENABLED]= false;
params[ConfigConstants.CFG_DVMS_SERVICE_NAME]= "My App";

// Set multiple parameters API, asynchronously
dapi.configuration.setParameters(params, function(ret) {
    var status;
    switch (ret) {
        case 0: status = "OK"; break;
        case -1: status = "ErrorNotFound"; break;
        case -2: status = "ErrorNotWritable"; break;
        case -3: status = "ErrorInvalidValue"; break;
        case -4: status = "ErrorGeneric"; break;
        default: status = "ErrorUndefined"; break;
    }
console.log("Test Set multiple - " + JSON.stringify(params) + ", status: " + status);
});