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
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
HMI 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 must 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 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

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