Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
Documentation
AddCommand

AddCommand

Type
Function
Sender
SDL
Purpose
Add a command for voice recognition

Request

If the application sends AddCommand with the vrCommands parameter then SDL Core will maintain a list of the added vrCommands.
For each AddCommand, only the first item in the vrCommands array shall be added to the list.

Whenever the internal list of added vrCommands is updated SDL Core must:
Construct the vrHelp and helpPrompt parameters using the data from the list SDL created internally.
Send these parameters to the HMI via the SetGlobalProperties RPC.

If the application sends a CreateInteractionChoiceSet RPC request that contains vrCommand parameters, SDL Core will send the HMI a VR.AddCommand request for each Choice.

Note

The parameter type included in the VR.AddCommand request is the differentiator the HMI should use to know if the VR Command originated from an AddCommand RPC or a CreateInteractionChoiceSet RPC.

Choice type VR Commands should only be used during a PerformInteraction RPC Request.

Command type VR Commands should only be used when the user wants to interact with the App's Menu.

Parameters

Name Type Mandatory Additional
cmdID Integer true minvalue: 0
maxvalue: 2000000000
vrCommands String true array: true
minsize: 1
maxsize: 100
maxlength: 99
type Common.VRCommandType true
grammarID Integer true minvalue: 0
maxvalue: 2000000000
appID Integer false

Response

Parameters

This RPC has no additional parameter requirements

Sequence Diagrams

JSON Message Examples

Example Request

{
  "id" : 119,
  "jsonrpc" : "2.0",
  "method" : "VR.AddCommand",
  "params" :
  {
    "cmdID" : 4365,
    "vrCommands" :
    [
         "Leave",
         "Exit",
         "Quit"
    ],
    "grammarID" : 123,
    "type" : "Command",
    "appID" : 64467
  }
}

Example Response

{
  "id" : 119,
  "jsonrpc" : "2.0",
  "result" :
  {
    "code" : 0,
    "method" : "VR.AddCommand"
  }
}

Example Error

{
  "id" : 119,
  "jsonrpc" : "2.0",
  "error" :
  {
    "code" : 13,
    "message" : "Provided appID is not valid",
    "data" :
    {
      "method" : "VR.AddCommand"
    }
  }
}
View on GitHub.com
Previous Section Next Section