Read GPS data (Waipoint, Track, ...) from Garmin GPS with C#

  • Posted on: 6 January 2011
  • By: markus.wilhelm

I wanted to read track data from any Garmin GPS device directly via my C# code. I found lots of classes and libraries for free and lots of where I had to pay for. But all of them had the same problem that communication via the COM Port seems to be verry buggy. I decided to develop my own and found that this is not that easy ;-(.

I did a lot of brainstorming and found a tricky way of how to do this. I make use of the Garmin Plugin for browsers. But how? Quite easy, more easy than you would expect. I implemented a webbrowser control into the C# form. The URL of this webbrowser control is a local Html file which implements the Garmin JavaScript library. After the actions of the Html implementation is finished  I read the data I want to have using the methods provided to the browser control like this: webBrowserGPS.Document.GetElementById("deviceInfoText").InnerText The important part now is to developt the Html page which offers user interaction in several ways.

You will find the Java Script sources together with some examples and the documentation at the Garmin Website:
I added my example fot the Html and Javascript implementation to my download Area.