fredyip 0 Newbie Poster

Hi guys,

I have written a program to read streaming GPS data from a GPS usb device. I am using CreateFile() and all seems to be all right except for time synchronization.

The Usb device, once connected, will continuously stream GPS data. No initialization is required, i.e. even using Hyperterminal, once the baudrate, stop bit etc are set, the GPS will continuously send the data.

I wrote a C++ program using CreateFile(), and I can collect the data streamed from the GPS. Problem is the GPS sends a new data every 1 second (it has its own clock) and my laptop has its own processor clock. So after reading say 10 seconds of data, the 11th sec data won't be read due to time synchronization. Then when the clocks on both devices (GPS and laptop) synchronized again, data is collected.

What can I do to rectify this problem? The GPS device comes with a .exe program and running it does not gives this problem. Every sec data is collected with it. But not for my program.

Cheers!
Frederick

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.