"Dimitar Stoyanov" <[EMAIL PROTECTED]> wrote:
> My program has to listen for data at the serial port for a long time - I
> don't know when the receiving data will come - it can be in a second but it
> can be in an hour. And if the port is opened for the whole time the
> batteries will gone very fast :(.
>
> So, my question is: Is there a way which does not spend so much power when
> listening for data at the serial port? - Just like Beam function on the
> Palm - the Palm is always ready for getting data via IR port and obviously
> it does not consume much energy.
Do you have control of the other end of the serial line? If so, why not
use the hardware handshake lines? I don't think you can cause the Palm
device to awaken with them, but you could set an alarm for yourself,
and poll the handshake line in the alarm handler. If the line is
active, set a feature and then feed a nil event into the queue. You
should be able to keep the serial port closed during this alarm/polling
sequence, thus conserving battery life.
You can probably take it from here.
--
Roger Chaplin
<[EMAIL PROTECTED]>