Question

I want retrieve data from my integrated gps hardware..i've read more post on stackoverflow but i don't found the c# source code. Thanks a lot...

Was it helpful?

Solution

see my GPSsample here http://www.hjgode.de/wp/2010/06/11/enhanced-gps-sample-update/

The clue to get the raw NMEA data is to use the GPSID direct port. It is encoded in the regitrsy:

        private string GetGPSPort()
    {
        string szStr="";
        if (Registry.GetStringValue(Registry.HKLM,
                        "System\\CurrentControlSet\\GPS Intermediate Driver\\Multiplexer",
                        "DriverInterface",
                        ref szStr)
            == 0)
        {
            return szStr;
        }
        else 
        {
            if (Registry.GetStringValue(Registry.HKLM,
                "System\\CurrentControlSet\\GPS Intermediate Driver\\Drivers",
                "CurrentDriver",
                ref szStr) == 0)
            {
                string szPath = "System\\CurrentControlSet\\GPS Intermediate Driver\\Drivers\\" + szStr;
                if (Registry.GetStringValue(Registry.HKLM, szPath, "CommPort", ref szStr) == 0)
                {
                    return szStr;
                }
            }
        }
        return "";
    }

The above gives the port name you can use to open and read the RAW NMEA data.

The above assumes the device supports MS GPSID.

Further there are two possiblities to use the raw port: a) using Serial communication or b) using a stream. Both access and read methods are used in the full source code available via the web site.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top