gpsd-dev
[Top][All Lists]
Advanced

[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: Sun, 18 Dec 2016 12:51:33 -0800 (PST)

On Fri, 16 Dec 2016, Sanjeev wrote:

> ---
>  gpsd.php.in | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/gpsd.php.in b/gpsd.php.in
> index e16e957..854c4c1 100644
> --- a/gpsd.php.in
> +++ b/gpsd.php.in
> @@ -462,7 +462,10 @@ EOF;
>               $sats = $sky['satellites'];
>
>               $fixtype = array('Unknown' => 0, 'No Fix' => 1,'2D Fix' => 2, 
> '3D Fix' => 3);
> -                $type = array_search($fix['mode'],$fixtype);
> +             $type = array_search($fix['mode'],$fixtype);
> +
> +             $statustype = array('No Fix' => 0, 'Without DGPS' => 1,'With 
> DGPS' => 2);
> +             $status = array_search($fix['status'],$statustype);
>
>               $nsv = count($sats);
>                  $ts = $fix['time'];
> --
> 2.10.2

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.

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
as well.  Thus, at this point, I think only PATCH 1 is a candidate for
merging, though it makes sense to move the indentation correction from
PATCH 2 into PATCH 1.  I've made that change on my 'sanjeev' branch.

Fred Wright



reply via email to

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