ssCore.SerialIO.writeBinary

Write binary data to the COM port.


Availability:

First available in version 3.8 build 333.


Input Parameters:

data - Data

timeout - Timeout in milliseconds


Output Parameters:

No output parameters.


Asynchronous Mode:

When this method is called asynchronously, a return object containing the output parameters is passed to the specified callback function.

ssCore.SerialIO.writeBinary( paramsObject [, callbackParamsObject] [, errorParamsObject] );


Synchronous Mode:

When this method is called synchronously, a return object containing the output parameters is returned to the caller immediately.

var returnObject = ssCore.SerialIO.writeBinary( paramsObject );


Notes:

None.


Examples:

ssCore.SerialIO.open({port:"com1", baudRate:"115200", parity:"none", dataBits:8, stopBits:1});

// the hex string "4920616d207468652064617461" will be sent as "I am the data"
var r:Object = ssCore.SerialIO.writeBinary({data:"4920616d207468652064617461", timeout:1000});
if (!r.success) ssDebug.trace("writeBinary failed: " + r.Error.description);