[Xastir] SiRF GPRMC bug? and GPGGA format

Derrick J Brashear shadow at dementia.org
Sun May 15 17:26:23 EDT 2005


On Sun, 15 May 2005, Derrick J Brashear wrote:

> On Sun, 15 May 2005, Richard E. Polivka wrote:
>
>> The GPS unit will work in NMEA and SI-RF binary modes. Whenever I have gpsd 
>> running, it puts the GPS into binary mode. So, IMO, it would have to take 
>> the binary data and recreate and serve NMEA strings for clients to use upon 
>> the client's request. I will check to see if I can keep gpsd from switching 
>> to binary and see if that helps.
>
> Oh. SiRF. I forgot SiRF. Let me see if I can fix it.
>
>>> Note also, is GPSD generating that string? Only Zodiac (earthmate) 
>>> generates the strings, otherwise it just passes you what the receiver 
>>> sends. If that's what the receiver is sending, gpsd does not, and really, 
>>> should not, be patching the strings.

So, 1) GPRMC specified 07.4f, which means a total field width of 7, 
padded at left with zeroes, and 4 digits to the right of the .

So how does 179.5430 render? That's an 8 character field.

2) GPGGA should have the same padding applied.

Comments?

--- libgpsd_core.c      (revision 2404)
+++ libgpsd_core.c      (working copy)
@@ -321,7 +321,7 @@
      gmtime_r(&intfixtime, &tm);
      if (session->gpsdata.fix.mode > 1) {
         sprintf(bufp,
-               "$GPGGA,%02d%02d%02d,%.4f,%c,%.4f,%c,%d,%02d,%s,%.1f,%c,",
+     		"$GPGGA,%02d%02d%02d,%08.4f,%c,%08.4f,%c,%d,%02d,%s,%.1f,%c,",
                 tm.tm_hour,
                 tm.tm_min,
                 tm.tm_sec,
@@ -349,7 +349,7 @@
         bufp += strlen(bufp);
      }
      sprintf(bufp,
-           "$GPRMC,%02d%02d%02d,%c,%07.4f,%c,%07.4f,%c,%.4f,%.3f,%02d%02d%02d,,",
+           "$GPRMC,%02d%02d%02d,%c,%08.4f,%c,%08.4f,%c,%.4f,%.3f,%02d%02d%02d,,",
             tm.tm_hour,
             tm.tm_min,
             tm.tm_sec,




More information about the Xastir mailing list