int64 AddCmdUtf8(string devName, string cmd, 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. |
cmd |
string JavaScript string that will be encoded to UTF-8 bytes when sent to device. Most of the time, a device will only support ASCII bytes, but this will suffice because UTF-8 is backward compatible with ASCII. |
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.AddCmdUtf8('myDev', 'Hello'))
console.log('EMERGENCY! It is NOT!');
Requirements
KioWare for Windows version 8.37 or greater.