D028868 CR1500 CR1100 CR2700 JavaScript Programming Guide User Manual Page 25 of 41
The Code Corporation
12393 South Gateway Park Place, Suite 600, Draper, UT 84020
+1 (801) 495-2200
FAX +1 (801) 495-0280
Informational Properties
comm.isConnected
The isConnected property of the comm object contains a read-only Boolean, specifying the
host connection status. Possible connection values are:
True: Reader is connected to the host.
False: Reader is not connected to the host.
Example:
if( comm.isConnected == false )
comm.connect;
Comm methods
comm.connect
The connect method instructs the Code reader communication driver to attempt to establish
a connection.
Note: Not applicable to wired products
comm.disconnect
The disconnect method instructs the Code reader communication driver to disconnect from
the host.
Note: Not applicable to wired products
comm.sendPacket
The sendPacket method instructs the Code reader to send a data packet to the host, via the
communications port currently specified by the active Code reader communication settings.
The Code reader creates a packet formatted according to the active Code reader packet
protocol configuration setting.
For a discussion of data packets, see the Code Interface Configuration Document, which can
be downloaded from http://www.codecorp.com.
Example:
var myPacket = “my data packet”;
comm.sendPacket(myPacket);
comm.sendText
The sendText method instructs the Code reader to send text to the host (which may include
NULL characters) via the active communication port; the text will be sent “raw” regardless of
the reader comm mode settings.
Example: