Casio Naurtech CETerm Ver.5.5 Scripting Guide Manuale Utente Pagina 100

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 164
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 99
NAURTECH WEB BROWSER AND TERMINAL EMULATION FOR WINDOWS CE AND WINDOWS MOBILE
CETerm Scripting Guide Page 100
Example
This example will wait for RF coverage to resume and sound a tone when it is
available. While waiting, a “tic” sound will be made periodically to indicate the
check. This sample is more complex than needed, but it illustrates how to use
global variables and timers to periodically check state.
/* RFSoundOnConnect */
// Global control variables
var RFWakeupSoundTimerID = 0;
var RFWakeupSoundContinue = 0;
var RFWakeupSoundInterval = 200; // milliseconds
var RFWakeupSoundCountMaximum = 50; // 50*200 = 10 seconds
var RFWakeupSoundCount = 0;
function OnWakeup ()
{
// Start with wakeup event
RFWakeupSoundStart();
}
// Function to start RF check
function RFWakeupSoundStart()
{
if (!RFWakeupSoundContinue)
{
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" );
Vedere la pagina 99
1 2 ... 95 96 97 98 99 100 101 102 103 104 105 ... 163 164

Commenti su questo manuale

Nessun commento