NMEA library - not parsing

I must be missing something with the configuration of the library as I am not seeing any parsing. This is the received data after conversion from bytes to String.

$HCHDG,243.0,0.0,E,6.0,E*41
$GPGLL,6025.85797,N,02213.84769,E,044024.89,A*00
$GPRMC,044023.94,A,6025
$HCHDG,243.0,0.0,E,6.0,E*41
$GPGLL,6025.85797,N,02213.84769,E,044024.89,A*00
$GPRMC,044024.89,A,6025

And this is the code I am testing with.

                    telegramStr = System.Text.Encoding.UTF8.GetString(telegram);
                    Debug.WriteLine(telegramStr);

                    Parser.Parse(telegram);

                    if (Parser.GLLSentence.DataStatus == Parser.DataStatus.Valid)
                    {
                        temp = Parser.GLLSentence.Latitude;
                        if (Parser.GLLSentence.LatitudeHemisphere == 'S')
                        {
                            temp = -temp;
                        }
                        var latitude = temp;

                        temp = Parser.GLLSentence.Longitude;
                        if (Parser.GLLSentence.LongitudePosition == 'W')
                        {
                            temp = -temp;
                        }
                        var longitude = temp;
                    }

The DataStatus is always zero when it checks it but the lat and lon are always zero.

If I set DataStatus to DataStatus.Invalid it never gets a valid.

What am I doing wrong?

Would this help?

https://docs.ghielectronics.com/software/tinyclr/drivers/software-utility.html

And maybe peek at the source code.

I did that and stepping into the code found that my data capture had some additional byte at the start. All sorted and working now.

Now to sort out the keyboard alignment and also the lack of visual feedback. :stuck_out_tongue:

2 Likes