Hi,
The best way is to use a wakeup handler. Using SrmSetWakupHandler you
establish a callback routine to be called at interrupt time.
SrmPrimeWakeupHandler tells the serial manager how many bytes need to arrive
before calling the callback routine. Typically this is set to 1. This doesn't
mean that the callback is called on every byte (see below).
Once in the callback routine you have are limited in what you can do.
Because it is called at interrupt time you cannot do anything that would
allocate memory, you cannot use the usual SrmReceive functions, you have no
globals. You do have a number of choices. You can use the ReceiveWindow calls
to access the serial input buffer, you can enqueue a key event (not a regular
event, but a key event in the key event queue; this is crucial), you can set a
feature, etc. etc. You should call EvtWakeup to ensure that the UI task is
woken up.
The callback is only called once then you must prime it again. A typical
use of the callback is to queue a key event and call EvtWakeup. The event
loop then kicks in, receives the key and does the necessary serial processing.
Once the app is ready to wait for more data to arrive the Wakeup Handler is
primed again.
Cheers,
Bruce Thompson
Senior Developer Support Engineer
Palm Computing, Inc.
--------------------------------------------------------
Date: 16 Nov 1999 09:44:35 -0800
From: "Anson, Gary/EXEUG3" <[EMAIL PROTECTED]>
Subject: Serial Event Notification
Is it possible to get asynchronous events posted by the serial manager? This
polling issue seems a little counter-paradigm having an event loop and no
event on serial data.