int SendRawCommand(string cmd, string callbackName = null, string devName = null)
Queues up a command for execution.
Parameters
Name | Description |
cmd |
string The command to send. |
callbackName |
(Optional) string A JavaScript function name that you would like KioWare to call with the result. If not specified or null, OnKioDeviceCmdResult will be called. |
devName |
(Optional) string Target the device via the name from the Config Tool. |
Return
On success, an incrementing number; the purpose of which is to match a particular call to a callback response. Upon failure, 0.
Security
Trust Level Required: Full Trust
Remarks
After an attempt to send the command to the device, whether successful or not, KioWare will call OnKioDeviceCmdResult in every frame (that has the required trust level) of every browser.
Example
if(!KioXTremePowerUPS.SendRawCommand('doit')) alert('fail!');
function OnKioDeviceCmdResult(devName, id, cmd, err, data)
{
KioApp.LogDiag('OnKioDeviceCmdResult ('+devName+'): id:'+id+' cmd:'+cmd+' err:'+err+' data:'+JSON.stringify(data));
}
Requirements
KioWare for Windows version 8.28 or greater.