With the shiny new GPSDriver library for WM5.0 devices, and later, with internal GPS we now have two incompatible ways of writing GPS apps. The "old" GPS library and Serial2 for serial ports, such as Bluetooth, and the new GPSDriver for GPS Intermediate Driver equipped devices.
I thought that it might be nice to be able to develop GPS apps on my laptops or desktop which use Bluetooth or USB GPS devices then port them to my Diamond which uses the Intermediate Driver. Also GPSDriver returns more information than GPS does and I wanted to be able access that on other platforms than an Intermediate Driver equipped device.
So here is a compatible solution, the GPSSerial library. It looks like GPSDriver to the code but hiding underneath is a SerialPort like in the Serial2 library. Porting code between the two should be a matter of changing your objects to use the correct library and altering the Open method which is the only one that differs between the two libraries.
This is quite a complex piece of code (have peek at the source!) and I have observed that the NMEA sentences from different devices don't all carry the same information in the same way. I have tested it on my Axim X30 (WM2003, Bluetooth) my desktop (Vista, RS232 to USB) and my EEE PC (XP, Bluetooth and RS232 to USB). However some code bugs may remain and there may be incompatibility problems with some devices. However if it will work with GPS and Serial2 it ought to work with this library.
EDIT :- Version 1.1 posted with corrected GPSSerialConverter object.
EDIT :- Version 1.2 posted. See post #16 for details.
EDIT :- Version 1.3 rapidly posted as I didn't get 1.2 quite right . See post #19 for details.
I thought that it might be nice to be able to develop GPS apps on my laptops or desktop which use Bluetooth or USB GPS devices then port them to my Diamond which uses the Intermediate Driver. Also GPSDriver returns more information than GPS does and I wanted to be able access that on other platforms than an Intermediate Driver equipped device.
So here is a compatible solution, the GPSSerial library. It looks like GPSDriver to the code but hiding underneath is a SerialPort like in the Serial2 library. Porting code between the two should be a matter of changing your objects to use the correct library and altering the Open method which is the only one that differs between the two libraries.
This is quite a complex piece of code (have peek at the source!) and I have observed that the NMEA sentences from different devices don't all carry the same information in the same way. I have tested it on my Axim X30 (WM2003, Bluetooth) my desktop (Vista, RS232 to USB) and my EEE PC (XP, Bluetooth and RS232 to USB). However some code bugs may remain and there may be incompatibility problems with some devices. However if it will work with GPS and Serial2 it ought to work with this library.
EDIT :- Version 1.1 posted with corrected GPSSerialConverter object.
EDIT :- Version 1.2 posted. See post #16 for details.
EDIT :- Version 1.3 rapidly posted as I didn't get 1.2 quite right . See post #19 for details.
Attachments
Last edited: