[ Summary of the problem so far: Set a wakeup handler and then when it goes
off try SerReceiveCheck or SrmReceiveWindowOpen, and it returns 0, meaning
no data available]

I think I may have an answer.

You can't call SerReceiveCheck or SrmReceiveWindowOpen from *within* your
wakeup handler.  Your wakeup handler can *only*:

    Set a global and/or
    Post a key to the event queue and/or
    re-prime itself.

In addition, it must be quick; it's called at interrupt time.

If you post a key with EvtEnqueueKey, it'll cause any pending EvtGetEvent to
return.  Then, you can just look for the specific key in your event loop.

At that point, SrmReceiveWindowOpen will work.

Here's my wakeup handler:
const UInt16 kWakeupKeyCode = 0;
const WChar kWakeupChr = 'x';

static void MyWakeupHandler(UInt32 refcon)
{
#pragma unused(refcon)
 EvtEnqueueKey(kWakeupChr, kWakeupKeyCode, commandKeyMask);
}

As far as I know, the keyCode must be 0, and the character can  be whatever
you want.  Unfortunately, I don't know how to distinguish between *your*
characters and actual graffiti characters. Setting the commandKeyMask
reduces the chance of conflicting with a  It'd be nice to have a character,
or range of characters which are reserved for application use [anyone able
to help on this point?].


Neil
--
Neil Rhodes
Calliope Enterprises, Inc.
1328 Clock Avenue
Redlands, CA  92374
(909) 793-5995     [EMAIL PROTECTED]      fax: (909) 793-2545


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

Reply via email to