User manual - Scripting_Guide

NAURTECH SMART CLIENTS FOR WINDOWS CE AND POCKET PC
CETerm Scripting Guide Page 51
{
RFWakeupSoundContinue = 1;
if (RFWakeupSoundTimerID != 0)
{
// Stop and clear any previous check
CETerm.ClearTimeout( RFWakeupSoundTimerID );
RFWakeupSoundTimerID = 0;
}
RFWakeupSoundCount = 0;
// Schedule first RF check
RFWakeupSoundTimerID = CETerm.SetTimeout(
"RFWakeupSoundOnTimer();",
RFWakeupSoundInterval );
}
}
// Function to check RF and notify user
function RFWakeupSoundOnTimer()
{
RFWakeupSoundTimerID = 0;
RFWakeupSoundCount++;
// Get and check info
var rfStatus = CETerm.GetProperty( "device.rf.status" );
if (rfStatus > 0)
{
// RF detected
// Delayed playsound, increase delay for WEP if needed
CETerm.SetTimeout( "RFWakeupSoundPlay();", 100 );
RFWakeupSoundContinue = 0;
}
else if (RFWakeupSoundCount > RFWakeupSoundCountMaximum)
{
// Failed to get RF, show failure message.
OS.Alert( "Failed to detect RF signal.\n" +
"Return to coverage area." );
RFWakeupSoundContinue = 0;
}
if (RFWakeupSoundContinue)
{
if (!(RFWakeupSoundCount % 5))
{
// Play "tick" sound while check is running.
CETerm.PlaySound( "MenuPop" );
}
// Schedule next RF check
RFWakeupSoundTimerID = CETerm.SetTimeout(
"RFWakeupSoundOnTimer();",
RFWakeupSoundInterval );