
4.0 CETerm Script Events
This section describes the script events within the CETerm script engine. These
events provide ways to trigger event handlers when various conditions occur in
CETerm. The event handlers are arbitrary scripts.
The event model in CETerm uses specific event handler names to bind events to
handlers. If the event handler function (e.g., “OnBarcodeRead”) is defined in the
script engine, it will be executed when the event occurs. There is no special
command required to register or bind the function to the event. Event handlers
can be re-defined at any time. If the handler is no longer needed, the function
can be re-defined as empty.
Events play a very important role for scripting in CETerm. Just as in the standard
web browser, a script cannot run continuously, or it will prevent user interaction
and other program actions. The script engine acts like a “virtual user”. When a
script is executing, CETerm will seem unresponsive. Typically, a script will do a
little bit of work and then exit. This way, CETerm is always ready to respond to
the user or host actions. Events and timers are used to start or re-start a script to
do the next bit of work.
The “expect” script described in Section 2.6 is a good example of using a timer to
automate multiple steps. The events described in this section are the second
major technique for running a script to satisfy a condition.
Receives special command in IBM data stream.
Keyboard state changes in TE session.
Fails to complete network check to host.
Serial port status changes.
Session connects to host.
User disconnects session from host.
Session disconnected by host.
TE session receives data from host.
Hardware trigger status changes.
Receives special command in VT data stream.
Device resumes after a suspend.
Commenti su questo manuale