java.lang.Object
com.smartdevicelink.proxy.RPCStruct
com.smartdevicelink.proxy.RPCMessage
com.smartdevicelink.proxy.RPCRequest
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:
The set of choices which the application builds using AddCommand can be a mixture of:
HMILevel needs to be FULL, LIMITED or BACKGROUND
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 | MenuParams | Name of the button to unsubscribe. | N | SmartDeviceLink 1.0 | |
vrCommands | List |
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 | |
secondaryImage | Image | Optional secondary image struct for menu cell | N | SmartDeviceLink 7.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
public static final java.lang.String KEY_CMD_ICON
public static final java.lang.String KEY_MENU_PARAMS
public static final java.lang.String KEY_CMD_ID
public static final java.lang.String KEY_VR_COMMANDS
public static final java.lang.String KEY_SECONDARY_IMAGE
Constructs a new AddCommand object
public AddCommand()
Constructs a new AddCommand object indicated by the Hashtable parameter
public AddCommand(java.util.Hashtable<java.lang.String, java.lang.Object> hash)
Constructs a new AddCommand object
public AddCommand(Integer cmdID)
Notes: Min Value: 0; Max Value: 2000000000
Returns an Integer object representing the Command ID that you want to add
public java.lang.Integer getCmdID()
Sets a Unique Command ID that identifies the command. Is returned in an OnCommand notification to identify the command selected by the user
public com.smartdevicelink.proxy.rpc.AddCommand setCmdID(Integer cmdID)
Notes: Min Value: 0; Max Value: 2000000000
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()
Sets Menu parameters
If provided, this will define the command and how it is added to the Command MenuIf null, commands will not be accessible through the HMI application menu
public com.smartdevicelink.proxy.rpc.AddCommand setMenuParams(MenuParams menuParams)
Gets Voice Recognition Commands
public java.util.List getVrCommands()
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 com.smartdevicelink.proxy.rpc.AddCommand setVrCommands(java.util.List<java.lang.String> vrCommands)
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
Gets the image to be shown along with a command
public com.smartdevicelink.proxy.rpc.Image getCmdIcon()
Sets the Image If provided, defines the image to be be shown along with a command
public com.smartdevicelink.proxy.rpc.AddCommand setCmdIcon(Image 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
Sets the secondaryImage.
public com.smartdevicelink.proxy.rpc.AddCommand setSecondaryImage(Image secondaryImage)
Gets the secondaryImage.
public com.smartdevicelink.proxy.rpc.Image getSecondaryImage()
From Class | Methods |
---|---|
com.smartdevicelink.proxy.RPCRequest | getCorrelationID, setCorrelationID, setOnRPCResponseListener, getOnRPCResponseListener |
com.smartdevicelink.proxy.RPCMessage | getFunctionID, getFunctionName, setFunctionName, getMessageType, setParameters, getParameters, getObject, getString, getInteger, getFloat, getDouble, getBoolean, getLong |
com.smartdevicelink.proxy.RPCStruct | getStoreValue, getStore, deserializeJSON, serializeJSON, serializeJSON, format, getBulkData, setBulkData, setPayloadProtected, isPayloadProtected, getMessageTypeName, hasKey, setValue, getValue, getObject, formatObject, getValueForString, getString, getInteger, getDouble, getFloat, getBoolean, getLong, clone, equals, hashCode |
java.lang.Object | getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize |