
78
Class Reference
Format:
result = comm.sendPacket(type, data);
Where:
type
– string, length 1; the type of packet to send. The packet types are documented in
the Interface Configuration Document.
data
– string; data to be inserted into the packet.
result
– Boolean;
false
if there was a failure on the communications port; otherwise,
true. If the current communications mode is a 2-way mode,
true
indicates that the data
has been sent to and acknowledged by the host.
Example:
reader.onDecode =
function(decode) {comm.sendPacket('z', decode.data)};
Sends a packet containing results of a decode to the current comm port.
4.5.1.4
sendText
The
sendText
method instructs the handheld reader to send arbitrary text (which may
include NULL characters) to be sent via the active communication port; the text will be sent
“raw” regardless of the reader
comm
mode settings. This method buffers the data until the
USB packet size limit is reached or a ‘z’ packet is sent. For an immediate response, send
the data as a ‘z’ packet using
comm.sendPacket
.
Format:
result = comm.sendText(data);
Where:
data
– string; data to be sent via the active communication port.
result
– Boolean;
false
if there was a failure on the communications port; otherwise,
true. If the current communications mode is a 2-way mode,
true
indicates that the data
has been sent to and acknowledged by the host.
Example:
reader.onDecode =
function(decode) {comm.sendText("decode.data"); }
Sends the raw text “decode.data” via the active communications port.
4.5.2
Properties
The following section documents the properties defined for the handheld
comm
object.