User manual - Scripting_Guide

NAURTECH SMART CLIENTS FOR WINDOWS CE AND POCKET PC
CETerm Scripting Guide Page 47
4.7 THE ONSESSIONDISCONNECTED EVENT
The OnSessionDisconnected event is fired when a terminal emulation (TE)
session is disconnected by the remote host. The handler can be used to attempt
to reconnect to the host or perform other cleanup tasks.
Syntax
function OnSessionDisconnected( session )
session – index of session which was disconnected by remote host.
Example
This example will check for RF coverage and attempt to reconnect if RF is
detected.
/* OnSessionDisconnected */
function OnSessionDisconnected( session )
{
// Check RF status
var status = CETerm.GetProperty( "device.rf.status" );
if (status <= 0)
{
OS.Alert( "No RF signal detected.\n" +
"Return to RF coverage and reconnect." );
return;
}
// Attempt to reconnect to host
CETerm.PostIDA( "IDA_SESSION_CONNECT", session );
}
4.8 THE ONSESSIONRECEIVE EVENT
The OnSessionReceive event is fired when a terminal emulation session
receives data from the connected host. The handler can be used to detect
screen content such as an error message and perform a desired action.
Syntax
function OnSessionReceive( session, count )