Serial Stuff

Discuss PocketC for CE (including Desktop Edition)

Postby john on Thu Jan 11, 2001 12:03 am

I've been playing with the eval version of pocketc. I want to write an interface for my gps receiver but am at a brick wall. The GPS sends an update message on the serial port every second.

How can you tell when the serial recieve buffer is empty? Or full? How can you empty it? I could "read it" empty if I knew how many bytes were there or if I knew when it was empty. Right now if I do a read, then go into a wait loop for 20 seconds or so the next read is 1 second older than the first (GPS message is time stamped in 10msec increments). If I do a 2000 byte garbage read then read again I get older data but I still don't know if there is more data remaining or if I've been wasting time waiting for new data after the buffer was emptied 1000 bytes ago. I'm about to give up!

John
john
 
Posts: 1
Joined: Wed Jan 10, 2001 11:47 pm

Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 2 guests

cron