All,

    The product that we are developing needs to use the serial port to
receive data.  I want to run this idea past you guys so that you can tell me
that it is not going to work, before I try to make it work =).

    Here is what I want to do (and why I want to do it).

    I cannot say much about the product, but here is what I want to do.
While our product is running it will continously be receiving data (events
in my vernacular) over the serial port.  For this reason, I need to keep the
serial port open.  I want to setup an interrupt handler so that I can handle
the event as soon as it appears in the serial port's receive buffer.  All of
our events are the same size so setting up the wakeup handler is perfect (if
I can make it work, see other messages in this thread).  I set it to look
for a packet of data that fits our event size.

    As soon as I receive the event I want to put it in to an event database.
I read on the palm website that you should not write to data storage memory
while in an interrupt handler.  Instead it recommends that I create a custom
event and post it to the event queue.  I don't want to do this because if
the user has the keyboard open, or some other system dialog, it will toss my
custom event away and I will never get it.  I cannot miss these events.
That is why I want to write it directly to an event database and then exit.
Is this feasible?  The only other thing that I might do in the interrupt
handler is put a custom event in to the event queue that says what type of
event I received just incase the form that the user is on needs to report
the event (this event is not important if the keyboard is open).

   When I receive a NIL event I will go handle the events that have been
entered in to the event database and delete them when done.  Doing it this
way has some very good advantages.  1.  If the user leaves the application
(or in some unlikely event, it crashes =) ) I still have the events in data
storage and the data is preserved.  2.  I have, for all practical purposes,
unlimited memory to store the events.  3. I don't need to implement a
polling method, which goes out to the serial port any time a system event is
received via EvtGetEvent().

    So, with all of this said.  If anyone out there has any advice for me,
please lay it on.  If what I want to do is truly impractical, please let me
know...you won't hurt my feelings telling me I am crazy!!!!

Thanks,

Brad Figler






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

Reply via email to