int SetLengthIndicators(int byteIndex = -1, int lengthModifier = 0, string callbackName = null, string devName = null)

Sets length byte indicators for reads.

Parameters

Name Description
byteIndex (Optional) int
Index (after any start sentinels) of the length byte in the packet, if any. Pass -1 to clear, which is the default. A successful read will end only when this length is met, excluding the length byte itself.
lengthModifier (Optional) int
The length byte assumes that its value specifies the length of all data following it. However, that is not always the case. This modifier should be used to add or subtract in order to meet the required length.
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.SetLengthIndicators(2, -1)) console.log('Device NOT open!');

Requirements

KioWare for Windows version 8.12 or greater.