GPS Driver for .Net/C# for Pulling GPS Data From Any NMEA-Capable GPS Unit

Michael Mankus picture Michael Mankus · Mar 27, 2013 · Viewed 9.7k times · Source

I have a mapping application and I want to be able to allow my users to connect any GPS unit which spits out NMEA data over a comm port or USB port.

Since the NMEA is a standard that the GPS units must adhere to, I'd assume a generic driver could be written to connect to the GPS units and begin accepting NMEA data. After a web search I was surprised not to find anyone who had done this for .NET in C#.

Am I missing something? Is there a level of complexity I am missing? Anyone have recommendations on how to make my application work with a wide array of GPS units?

Answer

yasth picture yasth · Mar 27, 2013

You don't really want a driver, you want a parser. The driver is what handles making it (almost always) a com port, and is device specific. The parser interprets the actual NMEA formatted data. Look at this parser project

http://code.google.com/p/nmeasharp/wiki/NmeaSharpMain

The lack of results is probably more an issue of lack of difficulty than anything else, it is a very easy format to parse.

Of course you can also use the windows 7+ Sensor and Location API

http://www.codeguru.com/csharp/.net/article.php/c16973/Using-the-Windows-7-Sensor-and-Location-Platform-from-C.htm

If you have a choice I'd use the Location API, but that is just me, and it isn't as well supported for any GPS. You can use an adapter to convert any standard NMEA gps to one supported by windows 7 if you like

http://www.turboirc.com/gps7/

Though that may pose a problem if you have commercial uses planned (though it would not be that hard to write a replacement).