]> err.no Git - mapper/commitdiff
Set fix information properly.
authorKaj-Michael Lang <milang@angel.tal.org>
Wed, 3 Oct 2007 16:01:20 +0000 (19:01 +0300)
committerKaj-Michael Lang <milang@angel.tal.org>
Wed, 3 Oct 2007 16:01:20 +0000 (19:01 +0300)
src/gps-nmea-parse.c
src/gpsdata.h

index 2f6ded3f4af998f600566c576337540f5889ab97..6e2300b4778e9ada66ef3c18c9d799e32766e295 100644 (file)
@@ -279,7 +279,9 @@ channel_parse_gsa(gchar * sentence)
         *  7) Checksum
         */
        gchar *token;
-       guint i;
+       guint i,si;
+       gint satforfix[12];
+
        vprintf("%s(): %s\n", __PRETTY_FUNCTION__, sentence);
 
 #define DELIM ","
@@ -294,9 +296,20 @@ channel_parse_gsa(gchar * sentence)
 
        _gps.satinuse = 0;
        for (i = 0; i < 12; i++) {
+               gint fprn;
                token = strsep(&sentence, DELIM);
                if (token && *token)
-                       _gps.satforfix[_gps.satinuse++] = atoi(token);
+                       fprn=atoi(token);
+               else
+                       fprn=-1;
+               satforfix[i]=fprn;
+               _gps.sat[i].fix=FALSE;
+       }
+
+       for (i=0;i<12;i++)
+               for (si=0;si<12;si++) {
+                       if (_gps.sat[i].prn==satforfix[si])
+                               _gps.sat[i].fix=TRUE;
        }
 
        /* PDOP */
index 12e206e78f215a4cecd95eb4e91c0dd32a6dfc86..dbd58b03fd9b8b25e4e377767566cb832c6e48ef 100644 (file)
@@ -33,7 +33,6 @@ struct _GpsData {
        gint vel_offsety;
        guint satinview;
        guint satinuse;
-       guint satforfix[GPS_SAT_MAX];
        GpsSatelliteData sat[GPS_SAT_MAX];
 };