Package: gpsd
Version: 2.33-4
Severity: important
Tags: patch

gpsd normally relies on the GSA string to supply the type of fix (none,
2D or 3D). However, when it gets position data from an RMC string,
it also tries to set the type of fix accordingly if there is no GSA
data. (The logic is that if the RMC string says that there is "V"alid
position data, we must at least have a 2D fix. I believe this could be
done for GGA; I don't know why this is not done.)

This fix is, however, broken -- what happens (at least on my system) is
that session->gpsdata.newdata.mode contains MODE_2D for some reason,
without MODE_SET ever being set in any mask. This means that the
corrected mode data never makes its way from session->gpsdata.newdata
into session->gpsdata.fix, which means that gpsd claims "M=0" (no fix)
when it has enough data to understand that there should be a fix.

I believe the included patch corrects this logic; it looks at the data
from session->gpsdata.fix (which should, if I understand the gpsd logic
correctly, contain the currently parsed information from this packet so
far) when deciding whether to override the mode or not.

diff -ur gpsd-2.33/nmea_parse.c gpsd-2.33.patched/nmea_parse.c
--- gpsd-2.33/nmea_parse.c      2006-06-09 14:36:07.000000000 +0200
+++ gpsd-2.33.patched/nmea_parse.c      2007-02-07 22:41:55.000000000 +0100
@@ -126,7 +126,7 @@
            session->gpsdata.status = STATUS_NO_FIX;
            mask |= STATUS_SET;
        }
-       if (session->gpsdata.newdata.mode >= MODE_2D) {
+       if (session->gpsdata.fix.mode >= MODE_2D) {
            session->gpsdata.newdata.mode = MODE_NO_FIX;
            mask |= MODE_SET;
        }
@@ -157,7 +157,7 @@
            session->gpsdata.status = STATUS_FIX;       /* could be DGPS_FIX, 
we can't tell */
            mask |= STATUS_SET;
        }
-       if (session->gpsdata.newdata.mode < MODE_2D) {
+       if (session->gpsdata.fix.mode < MODE_2D) {
            session->gpsdata.newdata.mode = MODE_2D;
            mask |= MODE_SET;
        }

-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.19.1
Locale: LANG=nb_NO.UTF-8, LC_CTYPE=nb_NO.UTF-8 (charmap=UTF-8)

Versions of packages gpsd depends on:
ii  debconf [debconf-2.0]       1.5.11       Debian configuration management sy
ii  libc6                       2.3.6.ds1-11 GNU C Library: Shared libraries
ii  libdbus-1-3                 1.0.2-1      simple interprocess messaging syst
ii  libgcc1                     1:4.1.1-21   GCC support library
ii  libstdc++6                  4.1.1-21     The GNU Standard C++ Library v3
ii  lsb-base                    3.1-23       Linux Standard Base 3.1 init scrip
ii  netbase                     4.29         Basic TCP/IP networking system

Versions of packages gpsd recommends:
ii  gpsd-clients                  2.33-4     clients for the GPS daemon
ii  python                        2.4.4-2    An interactive high-level object-o

-- debconf information:
* gpsd/start_daemon: true
* gpsd/device: /dev/ttyUSB0
* gpsd/daemon_options:


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to