Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Documentation
Sidebar

Class AddCommand

Hierarchy

java.lang.Object
     com.smartdevicelink.proxy.RPCStruct
         com.smartdevicelink.proxy.RPCMessage
             com.smartdevicelink.proxy.RPCRequest

Package
com.smartdevicelink.proxy.rpc

Overview

This class will add a command to the application's Command Menu

Note: A command will be added to the end of the list of elements in the Command Menu under the following conditions:

  • When a Command is added with no MenuParams value provided
  • When a MenuParams value is provided with a MenuParam.position value greater than or equal to the number of menu items currently defined in the menu specified by the MenuParam.parentID value

The set of choices which the application builds using AddCommand can be a mixture of:

  • Choices having only VR synonym definitions, but no MenuParams definitions
  • Choices having only MenuParams definitions, but no VR synonym definitions
  • Choices having both MenuParams and VR synonym definitions

HMILevel needs to be FULL, LIMITED or BACKGROUD

Parameter List

Param Name Type Description Req. Notes Version Available
cmdID Integer unique ID of the command to add Y minvalue:0; maxvalue:2000000000 SmartDeviceLink 1.0
menuParams ButtonName Name of the button to unsubscribe. Y SmartDeviceLink 1.0
vrCommands String

An array of strings to be used as VR synonyms for this command.

If this array is provided, it may not be empty.

N minsize:1; maxsize:100 SmartDeviceLink 1.0
cmdIcon Image

Image struct determining whether static or dynamic icon.

If omitted on supported displays, no (or the default if applicable) icon shall be displayed.

N SmartDeviceLink 1.0

Response

Indicates that the corresponding request has failed or succeeded, if the response returns with a SUCCESS result code, this means a command was added to the Command Menu successfully.

Non-default Result Codes:

INVALID_ID

DUPLICATE_NAME

Fields

KEY_CMD_ICON

public static final java.lang.String KEY_CMD_ICON
Constant Value
"cmdIcon"

KEY_MENU_PARAMS

public static final java.lang.String KEY_MENU_PARAMS
Constant Value
"menuParams"

KEY_CMD_ID

public static final java.lang.String KEY_CMD_ID
Constant Value
"cmdID"

KEY_VR_COMMANDS

public static final java.lang.String KEY_VR_COMMANDS
Constant Value
"vrCommands"

Inherited Fields

From Class Fields
com.smartdevicelink.proxy.RPCRequest onResponseListener
com.smartdevicelink.proxy.RPCMessage KEY_REQUEST, KEY_RESPONSE, KEY_NOTIFICATION, KEY_FUNCTION_NAME, KEY_PARAMETERS, KEY_CORRELATION_ID, messageType, parameters, function
com.smartdevicelink.proxy.RPCStruct KEY_BULK_DATA, KEY_PROTECTED, store

Constructors

AddCommand()

Constructs a new AddCommand object

public AddCommand()

AddCommand( java.util.Hashtable<java.lang.String, java.lang.Object> hash )

Constructs a new AddCommand object indicated by the Hashtable parameter

public AddCommand(java.util.Hashtable<java.lang.String, java.lang.Object> hash)

Parameters

hash
The Hashtable to use

AddCommand( Integer cmdID )

Constructs a new AddCommand object

public AddCommand(Integer cmdID)

Parameters

cmdID
an integer object representing a Command ID

Notes: Min Value: 0; Max Value: 2000000000

Methods

getCmdID()

Returns an Integer object representing the Command ID that you want to add

public java.lang.Integer getCmdID()

setCmdID( Integer cmdID )

Sets an Unique Command ID that identifies the command. Is returned in an OnCommand notification to identify the command selected by the user

public void setCmdID(Integer cmdID)

Parameters

cmdID
an integer object representing a Command ID

Notes: Min Value: 0; Max Value: 2000000000

getMenuParams()

Returns a MenuParams object which will defined the command and how it is added to the Command Menu

public com.smartdevicelink.proxy.rpc.MenuParams getMenuParams()

setMenuParams( MenuParams menuParams )

Sets Menu parameters

If provided, this will define the command and how it is added to the Command Menu

If null, commands will not be accessible through the HMI application menu

public void setMenuParams(MenuParams menuParams)

Parameters

menuParams
a menuParams object

getVrCommands()

Gets Voice Recognition Commands

public java.util.List getVrCommands()

setVrCommands( java.util.List<java.lang.String> vrCommands )

Sets Voice Recognition Commands

If provided, defines one or more VR phrases the recognition of any of which triggers the OnCommand notification with this cmdID

If null, commands will not be accessible by voice commands (when the user hits push-to-talk)

public void setVrCommands(java.util.List<java.lang.String> vrCommands)

Parameters

vrCommands
List indicating one or more VR phrases

Notes: Optional only if menuParams is provided. If provided, array must contain at least one non-empty (not null, not zero-length, not whitespace only) element

getCmdIcon()

Gets the image to be shown along with a command

public com.smartdevicelink.proxy.rpc.Image getCmdIcon()

setCmdIcon( Image cmdIcon )

Sets the Image If provided, defines the image to be be shown along with a command

public void setCmdIcon(Image cmdIcon)

Parameters

cmdIcon

an Image obj representing the Image obj shown along with a command

Notes: If omitted on supported displays, no (or the default if applicable) icon will be displayed

Inherited Methods

From Class Methods
com.smartdevicelink.proxy.RPCRequest getCorrelationID, setCorrelationID, setOnRPCResponseListener, getOnRPCResponseListener
com.smartdevicelink.proxy.RPCMessage getFunctionName, setFunctionName, getMessageType, setParameters, getParameters, getObject, getString, getInteger, getFloat, getDouble, getBoolean, getLong
com.smartdevicelink.proxy.RPCStruct getStoreValue, getStore, deserializeJSON, deserializeJSONObject, serializeJSON, serializeJSON, format, getBulkData, setBulkData, setPayloadProtected, isPayloadProtected, getMessageTypeName, hasKey, setValue, getValue, getObject, formatObject, getValueForString, getString, getInteger, getDouble, getFloat, getBoolean, getLong
java.lang.Object getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize
View on GitHub.com
Previous Section Next Section