At 10:50 AM -0700 2000/01/31, Jason Simpkins wrote:
>I have found that the SerRecieveWait function does not work correctly at all on 3.3, 
>causes the POSE to hang.

Can you describe the POSE behavior more specifically? When you say "hang" does the 
host machine running POSE block, or the emulated Palm OS application block, or 
something else?

What underlying serial protocol are you using when this occurs (e.g. IrComm, plain 
cradle-port serial I/O, etc.)? IrComm may have some trouble with SerReceiveWait, as 
this API relies on a fully interrupt driven implementation of the underlying serial 
driver to fill its receive queue with data. IrComm is actually running as a background 
task, however, and so requires a substantial number of execution cycles for which the 
SerReceiveWait loop probably isn't providing -- it's currently just a sit-and-spin 
loop which looks a bit like this (pseudo code):

  while (1)
    { 
      status = DrvStatus(...);
      if (status & drvrStatusDataReady) break;
      if timeout return;
    }

SerReceiveWait is generally not recommended to be called from the UI task, as it 
completely blocks the user from interacting with the device while waiting for serial 
data to be received. Or put another way, it was originally intended for use only by 
HotSync, which runs as a background task. Just an little explanation of the evolution 
of these APIs to help understand their behaviors.


>I use a SerCheck and wait until there is x amount of bytes to read then use 
>SerReceive to retrieve them.  Works
>perfect and allows EvtHandleEvent to take care of pending events without the blocking 
>that SerReceiveWait does.
>And this it seems has been my problem all along with PalmOS3.3,  finally solved it 
>this weekend! Yeehaw.

Excellent! That's exactly the method we recommend.

Regards,

Jim Schram
3Com/Palm Computing
Partner Engineering



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to