int WriteBytes(string, Array)
Writes an array of bytes to the specified device.
Security
Trust Level Required: Full Trust
Parameters
Name | Description |
devName |
string Name of the device in the Configuration Tool |
bytesToSend |
Array The array of data to write to the device. |
Return
The number of bytes written to the device.
Remarks
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.
Examples
//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);
Requirements
KioWare for Windows version 8.11 or greater.