8 controlling a serial port from ceterm, 1 serialport objects – Casio Naurtech CETerm Ver.5.5 Scripting Guide User Manual
Page 112
N
AURTECH
W
EB
B
ROWSER AND
T
ERMINAL
E
MULATION FOR
W
INDOWS
CE
AND
W
INDOWS
M
OBILE
CETerm Scripting Guide
Page 112
OS.Alert( "Failed to confirm write of " +
fullyQualifiedKey );
}
return status;
}
NewRegistryDWORD may be used as follows.
// Write a new value
NewRegistryDWORD( "SOFTWARE\\Naurtech\\Test", "TestDword", 510 );
5.8
C
ONTROLLING A
S
ERIAL
P
ORT FROM
CET
ERM
This section describes how to control serial ports with scripting in CETerm. Both
real (e.g., “COM1:”) and virtual (e.g., “BSP1:”) serial ports can be fully controlled
and accessed from emulation or browser sessions.
Serial ports can be opened for read-access, write-access, or both. All serial port
settings can be configured and events can be generated when data is available
or when signal lines change state.
The SerialPort object can be used to integrate any serial device into CETerm;
such as a tethered scanner, scale, printer, Bluetooth scanner, or RFID reader.
As with all CETerm scripting features, we provide as much direct access to the
hardware as possible while hiding un-needed complexity. The SerialPort
object usage can be complex and the developer will need a good programming
foundation with event-driven concepts. Much of the SerialPort object
corresponds directly to the Windows Win32 serial port APIs. General information
can be found by searching msdn.microsoft.com w
ith the keywords “basic serial
communication
”.
5.8.1 SerialPort Objects
CETerm provides access to ten (10) SerialPort objects. By default, these
correspond to “COM0:” through “COM9:”, however, any SerialPort object can
be configured to control any named
port, such as “BSP1:” for a virtual Bluetooth
port. The SerialPort objects can be used from both the CETerm script engine
and the browser scripting environment.
When a SerialPort object is first accessed within CETerm, it begins with all
default settings and will maintain all updated settings while CETerm is running.