int WriteBytes(byte[] v, bool readResponse = true, string callbackName = null, string devName = null)

Queues a write command to send to the device.

Parameters

Name Description
bytesToWrite byte[]
An array of bytes to write. A byte is a number between 0 and 255, inclusive.
readResponse (Optional) bool
Pass false if a response is not expected from your command, otherwise the read will wait for a timeout, delaying subsequent commands. The default is true.
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

Example


if(!KioCustomSerialDevice.WriteBytes([3,7,255], false)) console.log('Device NOT open!');

Requirements

KioWare for Windows version 8.12 or greater.