int WriteBytes(string, Array)

Writes an array of bytes to the specified device.


Trust Level Required: Full Trust


Name Description
devName string
Name of the device in the Configuration Tool
bytesToSend Array
The array of data to write to the device.


The number of bytes written to the device.


The Configuration Tool will allow the user to provide a name for the device and provide a description. This name will be used for all communication between KioWare and the device. It is mandatory to use the identical string when calling into this method.


//The name of the device will be user defined in the Configuration Tool.
var devName = "device";
var writeToDevice = [];
var stringify = "KioWare";
for (var i = 0; i < stringify.length; i++)
	writeToDevice[i] = stringify.charCodeAt(i);
//write to device in decimal bytes
if(KioRawSerialDevice.WriteBytes(devName, writeToDevice) != writeToDevice.length) 
	console.log("Not all bytes written to " + devName);


KioWare for Windows version 8.11 or greater.