[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] Possible Bug in libgpsd_core.c

From: Gary E. Miller
Subject: Re: [gpsd-dev] Possible Bug in libgpsd_core.c
Date: Fri, 25 Jan 2019 13:05:37 -0800

Yo Neustifter!

On Mon, 21 Jan 2019 13:56:55 +0000
Neustifter Andreas <address@hidden> wrote:

> we have a u-blox NEO M8N chip connected via tty and used in binary
> mode. When the u-blox module loses the GPS signal and reports fix=1
> in the UBX_NAV_SOL message the gps_data.fix.mode variable is not
> updated (and stays at 3) BUT (gps_data.set & MODE_SET) still is true.

Yeah, we've known there are problems in that area.

> Attached a patch that attempts to fix this behavior, any thoughts on
> that?

Basically this:

-       /* don't downgrade mode if holding previous fix */
-       if (session->gpsdata.fix.mode > session->newdata.mode)
+       if (received & MODE_SET) {
+           gpsd_log(&session->context->errout, LOG_PROG, "mode change: was %d 
is %d\n", session->gpsdata.fix.mode, session->newdata.mode);
+       } else {
            session->gpsdata.set &= ~MODE_SET;
+       }

I agree the current behavior is wrong, the fix is harder to downgrade than
it should be.  But your fix is internally inconsistent.  Just because the
MODE_SET bit is set does not mean the mode changed.

When the code description does not match the code, then it is clear not
enough thought is in the patch.

While the old code is problematic, the new code is just misleading.  It
unsets MODE-SET, only when it is not set!  gpsdata.set was just set
from received, so their MODE_SET is always the same.

I'm just finishing up fixing some SiRFstar bugs, when that is under
control I'lll come back to this bug.

Thanks for the captures, they will help, and might become regression tests.

Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        address@hidden  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin

Attachment: pgpR3WVBa1rq1.pgp
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]