int SetSentinels(string begS, string endS, string callbackName = null, string devName = null)
Sets begin and end sentinels for reading.
Parameters
Name | Description |
beginSentinels |
string Begin sentinels to look for, indicating the beginning of a packet. Pass null to clear. |
endSentinels |
string End sentinels to look for, indicating the end of a packet. Pass null to clear. |
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
The data returned will not include the sentinels. To pass in sentinel characters that are not printable, use JavaScript escape codes, such as: \x01.
Example
if(!KioCustomSerialDevice.SetSentinels('\x03Begin','\x04End')) console.log('Device NOT open!');
Requirements
KioWare for Windows version 8.12 or greater.