WaitCommEvent() on PDA using GPS-device

L

Luk Vloemans

Hey,

I'm writing a program which will run on a PDA equipped with a GPS link.
I'm trying to read data from the GPS-device, but so far I've been out of
luck..

(OS: Windows CE - coding language: C# - GPS device: HI-303MMF - PDA:
COMPAQ iPAQ)

The GPS device uses a COM port of the PDA. This should be similar to
writing software for a normal COM-device on q desktop-pc.

Everything goes right up untill I use this function:

WaitCommEvent(uHandle, uMask, uOverlapped);

This function should normally wait untill data can be read from the
device. Unfortunalty, the function returns false. (failure)

According to GetLastError() the device handler (uHandle) is corrupt but
when debugging I can clearly see that my device handler _is_ set after
"CreateFile(cs.port, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);"

I'm a newbie at this level of programming and totally out of options.

Did anybody have the same problem, or any clue as to what might have
gone wrong ?

I checked the BaudRate, Data bit, Parity.. etc of the connection, and
those all seem to be in order..

Thanks a lot for any assistance,

Luk Vloemans
IT student
 
L

Luk Vloemans

Hey,

I found the solution to my problem. If anyone has a similar problem, you
should always use your original file handler, returned by CreateFile().

special thanks to Mattias Sjögren.

grtz,

Luk Vloemans
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top