[Top][All Lists]

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

Re: [gpsd-dev] [PATCH 2/3] Add reporting of if DGPS used

From: Fred Wright
Subject: Re: [gpsd-dev] [PATCH 2/3] Add reporting of if DGPS used
Date: Mon, 19 Dec 2016 18:44:00 -0800 (PST)

On Sun, 18 Dec 2016, Fred Wright wrote:

> This patch doesn't actually work.  First of all, after creating the
> $status variable, it never actually uses it.  Secondly, if I add code to
> use it, it comes up "No Fix" even when there is a valid fix.  Upon further
> investigation, I see no 'status' item in the TPV from an actual running
> GPSD built from recent sources (obtained via a current gpspipe running in
> -w mode).  I haven't investigated whether 'status' is optionally present,
> but if it is, the code needs to handle that properly.

After RTFM, I see that the 'status' field is indeed optional, so the basic
problem is that the code isn't handling its absence correctly.  Also,
according to the documentation, '2' is the only valid value, though I
didn't dig into the code to see if that's still true.  In any case, I
suggest handling it as follows:

1) If 'status' is missing, then leave the reported value blank.

2) If 'status' has a valid value, report the corresponding decode string.

3) If 'status' has an invalid/unrecognized value, report '?' or something

> Since a real GPSD doesn't report 'status' (at least in the cases I've
> observed), the update to the test data which includes it is questionable

So including a status of 2 isn't actually wrong, but if there's a way to
have more than one case in the test data (at least covering the
missing-field case), that would be good.  I didn't investigate whether
that's plausible.

Fred Wright

reply via email to

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