int64 AddCmd(string devName, string cmdHex, int timeoutMs = 0, bool hasResp = true, string callbackName = null)
Queues up a command for processing.
Parameters
Name | Description |
devName |
string Target the device via the name from the Config Tool. |
cmdHex |
string Hex encoded bytes for command. |
timeoutMs = 0 |
(Optional) int Timeout (in milliseconds) for command. If 0, a default, device specific timeout will be used. |
hasResp = true |
(Optional) bool Whether or not to wait for a response from device. |
callbackName = null |
(Optional) string Optionally, use a custom JavaScript callback function name for response. If null, OnKioDeviceCmdResult will be called. |
Return
An incrementing integer that can be used to match up a command with the response, or 0 upon failure.
Security
Trust Level Required: Full Trust
Example
if(!KioRawCmdDevice.AddCmd('myDev', '1A63FF'))
console.log('EMERGENCY! It is NOT!');
Requirements
KioWare for Windows version 8.37 or greater.