Subject: FW: Developing an "always on" application
From: Adam Holt <[EMAIL PROTECTED]>
Date: Sun, 08 Jun 2003 12:25:23 +0100
X-Message-Number: 5

I'm trying to determine the best platform on which to develop an industrial
application that is effectively "always on".  Actually the application does
very little most of the time apart from listen on a TCP socket over a WIFI
network.  When it receives a certain message it needs to wake up, play a
sound, and display some diagnostic data to the user.

I haven't yet decided whether to go down the Palm, Pocket PC, or Symbian
route, but the Tungsten-C seems like an attractive platform on which to
develop this application, mostly due its built-in WIFI.  However a couple of
questions spring to mind:

1. Presumably, like most handhelds, Tungsten-C will go into standby mode
after a period of inactivity.  Is it possible within an application to force
the OS to inhibit this behaviour?

2. What's the best way to achieve a pseudo-standby state - i.e. keeping my
"listening application" alive whilst minimising the overall power
consumption?

Actually don't do "Always on". Not necessary with Palm OS.


1) Use the Event handler to generate nilEvents every, say, 5 seconds

        EventType event;
        EvtGetEvent (&event, SysTicksPerSecond () * 5L);

2) When you receive a nilEvent, check how much time has elapsed since the last nilEvent. If enough time has passed, (say 15 seconds) check if anything is received on the socket.

Note: Additional nilEvents are generated so you have to keep track of the time between activations. Don't keep a count of nilEvents. See the archives for more details.

All this keeps your unit in doze mode most of the time and will maximize battery life.


PS: Don't forget to do NetLibConnectionRefresh() before any socket operations (see the documentation for more details)


Roger Stringer
Marietta Systems, Inc.  (www.RF-TP.com)


-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to