Alexa Auto SDK  2.3.0
Classes | Public Member Functions | Static Public Member Functions | List of all members
com.amazon.aace.carControl.CarControlConfiguration Class Reference

Classes

class  Action
 
class  Zone
 

Public Member Functions

final CarControlConfiguration createEndpoint (String endpointId)
 
final CarControlConfiguration createControl (String controlId, String zoneId)
 
final CarControlConfiguration addAssetId (String assetId)
 
final CarControlConfiguration addPowerController (boolean retrievable)
 
final CarControlConfiguration addToggleController (String instanceId, boolean retrievable)
 
final CarControlConfiguration addActionTurnOn (String[] actions)
 
final CarControlConfiguration addActionTurnOff (String[] actions)
 
final CarControlConfiguration addRangeController (String instanceId, boolean retrievable, double minimum, double maximum, double precision, String unit)
 
final CarControlConfiguration addPreset (double value)
 
final CarControlConfiguration addActionSetRange (String[] actions, double value)
 
final CarControlConfiguration addActionAdjustRange (String[] actions, double delta)
 
final CarControlConfiguration addModeController (String instanceId, boolean retrievable, boolean ordered)
 
final CarControlConfiguration addValue (String value)
 
final CarControlConfiguration addActionSetMode (String[] actions, String value)
 
final CarControlConfiguration addActionAdjustMode (String[] actions, int delta)
 
final CarControlConfiguration createZone (String zoneId)
 
final CarControlConfiguration addMembers (String[] endpointIds)
 
final CarControlConfiguration setDefaultZone (String zoneId)
 
final CarControlConfiguration addDefaultAssetsPath (String path)
 
final CarControlConfiguration addCustomAssetsPath (String path)
 

Static Public Member Functions

static CarControlConfiguration create ()
 

Detailed Description

The CarControlConfiguration class programmatically generates the "aace.carControl" com.amazon.aace.core.config.EngineConfiguration. "aace.carControl" configuration specifies additional endpoints that are connected and controllable through the root endpoint that maintains the connection to the Alexa service. Each connected endpoint represents a controllable component of the vehicle and should be configured with any of the supported capabilities (i.e. PowerController and primitives ModeController, ToggleController, RangeController ) to model how the endpoint can be controlled with voice.

Using the methods on an instance of this class produces configuration data in the format of the following example:

{
"aace.carControl": {
"endpoints": [
{
"endpointId": "default.ac",
"endpointResources": {
"friendlyNames": [
{
"@type": "asset",
"value": {
"assetId": "Alexa.Automotive.DeviceName.AirConditioner"
}
}
]
},
"capabilities": [
{
"type": "AlexaInterface",
"interface": "Alexa.PowerController",
"version": "3",
"properties": {
"supported": [
{
"name": "powerState"
}
],
"proactivelyReported": false,
"retrievable": false
}
},
{
"type": "AlexaInterface",
"interface": "Alexa.ModeController",
"version": "3",
"instance": "intensity",
"capabilityResources": {
"friendlyNames": [
{
"@type": "asset",
"value": {
"assetId": "Alexa.Automotive.Setting.Intensity"
}
}
]
},
"properties": {
"supported": [
{
"name": "mode"
}
],
"proactivelyReported": false,
"retrievable": false
},
"configuration": {
"ordered": true,
"supportedModes": [
{
"value": "LOW",
"modeResources": {
"friendlyNames": [
{
"@type": "asset",
"value": {
"assetId": "Alexa.Automotive.Value.Low"
}
},
{
"@type": "asset",
"value": {
"assetId": "Alexa.Automotive.Value.Minimum"
}
}
]
}
},
{
"value": "MEDIUM",
"modeResources": {
"friendlyNames": [
{
"@type": "asset",
"value": {
"assetId": "Alexa.Automotive.Value.Medium"
}
}
]
}
},
{
"value": "HIGH",
"modeResources": {
"friendlyNames": [
{
"@type": "asset",
"value": {
"assetId": "Alexa.Automotive.Value.High"
}
},
{
"@type": "asset",
"value": {
"assetId": "Alexa.Automotive.Value.Maximum"
}
}
]
}
}
]
},
"semantics" : {
"actionMappings": [
{
"@type": "ActionsToDirective",
"actions": ["Alexa.Actions.Raise"],
"directive": {
"name": "AdjustMode",
"payload": {"modeDelta": 1}
}
},
{
"@type": "ActionsToDirective",
"actions": ["Alexa.Actions.Lower"],
"directive": {
"name": "AdjustMode",
"payload": {"modeDelta": -1}
}
}
]
}
}
]
}
],
"zones": [
{
"zoneId": "zone.default",
"zoneResources": {
"friendlyNames": [
{
"@type": "asset",
"value": {
"assetId": "Alexa.Automotive.Location.All"
}
}
]
},
"members": [
{
"endpointId": "default.ac"
}
]
}
],
"defaultZoneId" : "zone.default",
"assets" : {
"customAssetsPath" : "/opt/AAC/assets-3P.json"
}
}
}

note This class acts as a configuration builder, so the method calls must be ordered to produce the intended configuration.

Member Function Documentation

◆ create()

static CarControlConfiguration com.amazon.aace.carControl.CarControlConfiguration.create ( )
static

Create a CarControlConfiguration instance.

◆ createEndpoint()

final CarControlConfiguration com.amazon.aace.carControl.CarControlConfiguration.createEndpoint ( String  endpointId)

Begin an endpoint definition using the specified endpoint ID. This creates a single entry in the "endpoints" array of 'aace.carControl'.

Note
Do not use the following format for the endpointId: <clientId>::<productId>::<serialNumber>::[-<extEndpoint>]. The Engine internally prepends the 3-part device prefix to your specified endpointId before sending the configuration to the cloud in an AddOrUpdateReport event. Configuring the full ID directly results in duplication and excess characters.
Parameters
endpointIdThe unique identifier for the endpoint.
Returns
CarControlConfiguration to allow chaining.

◆ createControl()

final CarControlConfiguration com.amazon.aace.carControl.CarControlConfiguration.createControl ( String  controlId,
String  zoneId 
)
Deprecated:
Use CarControlConfiguration.createEndpoint().
Note
This method is for backward compatibility. Do not use method addMembers() on a zone definition if you create endpoints with createControl(). addMembers() is only compatible with createEndpoint().
Do not use both createControl() and createEndpoint() in your implementation.

Begin an endpoint definition using the specified endpoint ID. This creates a single entry in the "endpoints" array of 'aace.carControl'.

Note
Do not use the following format for the endpointId: <clientId>::<productId>::<serialNumber>::[-<extEndpoint>]. The Engine internally prepends the 3-part device prefix to your specified endpointId before sending the configuration to the cloud in an AddOrUpdateReport event. Configuring the full ID directly results in duplication and excess characters.
Parameters
controlIdThe unique identifier for the endpoint.
zoneIdThe unique identifier of the zone the endpoint is located in. Default is "zone.all".
Returns
CarControlConfiguration to allow chaining.

◆ addAssetId()

final CarControlConfiguration com.amazon.aace.carControl.CarControlConfiguration.addAssetId ( String  assetId)

Add an asset ID to the enclosing element. This can be called to add an asset ID to the friendly names list for the following elements:

  • The 'endpointResources' of an endpoint definition
  • The 'capabilityResources' of a ToggleController, RangeController, or ModeController definition
  • The 'presetResources' of a RangeController preset definition
  • The 'modeResources' of a ModeController mode definition
Note
Specify only valid asset IDs. See CarControlAssets.java for a full list of the asset IDs supported by default.
Parameters
assetIdThe identifier of the asset.
Returns
CarControlConfiguration to allow chaining.

◆ addPowerController()

final CarControlConfiguration com.amazon.aace.carControl.CarControlConfiguration.addPowerController ( boolean  retrievable)

Add a PowerController capability to the enclosing endpoint. Only one instance is allowed per endpoint.

See also
https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/alexa-powercontroller.html.
Parameters
retrievableWhether the state of this instance may be retrieved by the Alexa service. Only false is supported.
Returns
CarControlConfiguration to allow chaining.

◆ addToggleController()

final CarControlConfiguration com.amazon.aace.carControl.CarControlConfiguration.addToggleController ( String  instanceId,
boolean  retrievable 
)

Add a ToggleController capability to the enclosing endpoint. Multiple instances are allowed per endpoint. Call addAsset() to add friendly names to the 'capabilityResources' of this instance.

See also
https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/alexa-togglecontroller.html.
Parameters
instanceIdThe identifier of this ToggleController instance. Must be unique with respect to the enclosing endpoint.
retrievableWhether the state of this instance may be retrieved by the Alexa service. Only false is supported.
Returns
CarControlConfiguration to allow chaining.

◆ addActionTurnOn()

final CarControlConfiguration com.amazon.aace.carControl.CarControlConfiguration.addActionTurnOn ( String []  actions)

Maps the specified action IDs to the TurnOn directive for the enclosing ToggleController. This adds a 'semantics.actionMappings' entry to its definition. com.amazon.aace.carControl.CarControl.turnToggleControllerOn() is invoked when the user says the additional utterances enabled by the specified action ID(s).

Note
Use a specific action ID only once per endpoint.
Only the action IDs defined in com.amazon.aace.carControl.CarControlConfiguration.Action are supported.
Parameters
actionsThe action IDs to map to the TurnOn directive.

◆ addActionTurnOff()

final CarControlConfiguration com.amazon.aace.carControl.CarControlConfiguration.addActionTurnOff ( String []  actions)

Maps the specified action IDs to the TurnOff directive for the enclosing ToggleController. This adds a 'semantics.actionMappings' entry to its definition. com.amazon.aace.carControl.CarControl.turnToggleControllerOn() is invoked when the user says the additional utterances enabled by the specified action ID(s).

Note
Use a specific action ID only once per endpoint.
Only the action IDs defined in com.amazon.aace.carControl.CarControlConfiguration.Action are supported.
Parameters
actionsThe action IDs to map to the TurnOff directive.

◆ addRangeController()

final CarControlConfiguration com.amazon.aace.carControl.CarControlConfiguration.addRangeController ( String  instanceId,
boolean  retrievable,
double  minimum,
double  maximum,
double  precision,
String  unit 
)

Add a RangeController capability to the enclosing endpoint. Multiple instances are allowed per endpoint. Call addAsset() to add friendly names to the 'capabilityResources' of this instance.

See also
https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/alexa-rangecontroller.html
Parameters
instanceIdThe identifier of this RangeController instance. Must be unique with respect to the enclosing endpoint.
retrievableWhether the state of this instance may be retrieved by the Alexa service. Only false is supported.
minimumThe minimum value of the range supported by this instance.
minimumThe maximum value of the range supported by this instance.
precisionThe amount by which the set value changes when iterating through the range.
unitThe unit of the measure.
Returns
CarControlConfiguration to allow chaining.

◆ addPreset()

final CarControlConfiguration com.amazon.aace.carControl.CarControlConfiguration.addPreset ( double  value)

Add a 'preset' to the enclosing RangeController instance. A preset describes a value that can be invoked by name. Call addAsset() to add friendly names to 'presetResources' of this preset.

Parameters
valueThe value within the range that has an associated named preset.
Returns
CarControlConfiguration to allow chaining.

◆ addActionSetRange()

final CarControlConfiguration com.amazon.aace.carControl.CarControlConfiguration.addActionSetRange ( String []  actions,
double  value 
)

Maps the specified action IDs to the SetRangeValue directive for the enclosing RangeController. This adds a 'semantics.actionMappings' entry to its definition. com.amazon.aace.carControl.CarControl.setRangeControllerValue() is invoked when the user says the additional utterances enabled by the specified action ID(s).

Note
Use a specific action ID only once per endpoint.
Only the action IDs defined in com.amazon.aace.carControl.CarControlConfiguration.Action are supported.
Parameters
actionsThe action IDs to map to the SetRangeValue directive.
valueThe value argument of setRangeControllerValue(). The value must be within the configured range of this RangeController instance.

◆ addActionAdjustRange()

final CarControlConfiguration com.amazon.aace.carControl.CarControlConfiguration.addActionAdjustRange ( String []  actions,
double  delta 
)

Maps the specified action IDs to AdjustRangeValue directive for the enclosing RangeController. This adds a 'semantics.actionMappings' entry to its definition. com.amazon.aace.carControl.CarControl/adjustRangeControllerValue() is invoked when the user says the additional utterances enabled by the specified action ID(s).

Note
Use a specific action ID only once per endpoint.
Only the action IDs defined in com.amazon.aace.carControl.CarControlConfiguration.Action are supported.
Parameters
actionsThe action IDs to map to the AdjustRangeValue directive.
deltaThe delta argument of adjustRangeControllerValue(). The absolute value must be <= (max - min) configured for this RangeController instance.

◆ addModeController()

final CarControlConfiguration com.amazon.aace.carControl.CarControlConfiguration.addModeController ( String  instanceId,
boolean  retrievable,
boolean  ordered 
)

Add a ModeController capability to the enclosing endpoint. Multiple instances are allowed per endpoint. Call addAsset() to add friendly names to the 'capabilityResources' of this instance.

See also
https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/alexa-modecontroller.html
Parameters
instanceIdThe identifier of this ModeController instance. Must be unique with respect to the enclosing endpoint.
retrievableWhether the state of this instance may be retrieved by the Alexa service. Only false is supported.
orderedWhether the modes are ordered, enabling iteration through them using the AdjustMode directive.
Returns
CarControlConfiguration to allow chaining.

◆ addValue()

final CarControlConfiguration com.amazon.aace.carControl.CarControlConfiguration.addValue ( String  value)

Add a supported mode 'value' to the enclosing ModeController instance. If ordered is true, the order in which modes are created with calls to this method determines the ordering for iteration by voice. Call addAsset() to add friendly names to 'modeResources' of this mode.

Parameters
valueThe identifier of the mode.
Returns
CarControlConfiguration to allow chaining.

◆ addActionSetMode()

final CarControlConfiguration com.amazon.aace.carControl.CarControlConfiguration.addActionSetMode ( String []  actions,
String  value 
)

Maps the specified action IDs to the SetMode directive for the enclosing ModeController. This adds a 'semantics.actionMappings' entry to its definition. com.amazon.aace.carControl.CarControl.setModeControllerValue() is invoked when the user says the additional utterances enabled by the specified action ID(s).

Note
Use a specific action ID only once per endpoint.
Only the action IDs defined in com.amazon.aace.carControl.CarControlConfiguration.Action are supported.
Parameters
actionsThe action IDs to map to the SetMode directive.
valueThe value argument of setModeControllerValue() specifying the mode to set. The value must be one configured for this ModeController instance.

◆ addActionAdjustMode()

final CarControlConfiguration com.amazon.aace.carControl.CarControlConfiguration.addActionAdjustMode ( String []  actions,
int  delta 
)

Maps the specified action IDs to the AdjustMode directive for the enclosing ModeController. This adds a 'semantics.actionMappings' entry to its definition. com.amazon.aace.carControl.CarControl.adjustModeControllerValue() is invoked when the user says the additional utterances enabled by the specified action ID(s).

Note
This may only be used if ordered is true for this ModeController instance.
Use a specific action ID only once per endpoint.
Only the action IDs defined in com.amazon.aace.carControl.CarControlConfiguration.Action are supported.
Parameters
actionsThe action IDs to map to the AdjustMode directive.
deltaThe delta argument of adjustModeControllerValue() specifying the number of modes to advance from the current mode setting.

◆ createZone()

final CarControlConfiguration com.amazon.aace.carControl.CarControlConfiguration.createZone ( String  zoneId)

Begin a zone definition using the specified zone ID. This creates a single entry in the "zones" array of 'aace.carControl'. Call addMembers() to add endpoint IDs as members of this zone.

Parameters
zoneIdThe unique identifier for the zone.
Returns
CarControlConfiguration to allow chaining.

◆ addMembers()

final CarControlConfiguration com.amazon.aace.carControl.CarControlConfiguration.addMembers ( String []  endpointIds)

Add the specified endpoint IDs to the definition of the enclosing zone.

Note
An endpoint ID added to this zone instance may belong to other zones as well.
Do not use deprecated method createControl() to create endpoints if using this method.
Parameters
endpointIdsThe IDs of the endpoints belonging to this zone. Endpoint IDs used must correspond to endpoints created with createEndpoint().
Returns
CarControlConfiguration to allow chaining.

◆ setDefaultZone()

final CarControlConfiguration com.amazon.aace.carControl.CarControlConfiguration.setDefaultZone ( String  zoneId)

Set the default zone to the specified zone ID. This allows the endpoints in the specified default zone to take precedence over endpoints not in the default zone when the user does not specify any zone in the utterance.

Note
There can only be one default zone. Multiple calls to this method will override the previously set default.
Parameters
zoneIdThe ID of the default zone.
Returns
CarControlConfiguration to allow chaining.

◆ addDefaultAssetsPath()

final CarControlConfiguration com.amazon.aace.carControl.CarControlConfiguration.addDefaultAssetsPath ( String  path)

Specify the path to a file that defines the default assets. This creates an "assets.defaultAssetsPath" entry in 'aace.carControl'.

Note
Using this method is not necessary or recommended. The default assets are already defined internally. including all supported locales and use the asset IDs present in CarControlAssets.h. This method can override the internal asset definitions in online-only use cases (without the LVC extension).
Parameters
pathThe path to the file defining the default assets.

◆ addCustomAssetsPath()

final CarControlConfiguration com.amazon.aace.carControl.CarControlConfiguration.addCustomAssetsPath ( String  path)

Specify the path to a file that defines additional assets. This creates an "assets.customAssetsPath" entry in 'aace.carControl'. Specify a path to additional assets if you have endpoints that cannot be modeled using the default asset IDs present in CarControlAssets.java.

Parameters
pathThe path to the file defining additional assets.

Alexa Auto SDK 2.3.0 - Copyright 2017-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0