summaryrefslogtreecommitdiff
path: root/driver_greis.c
diff options
context:
space:
mode:
authorFred Wright <fw@fwright.net>2018-12-28 21:35:16 -0800
committerFred Wright <fw@fwright.net>2018-12-28 21:35:16 -0800
commit68e426d3dc7543eb8c80b74f3359e4d3bbce75bd (patch)
tree784159c96cca1f13b944aee98f12ec9f31e63825 /driver_greis.c
parentd3eb78dd421df15555854ec2df3271cce80f9f06 (diff)
downloadgpsd-68e426d3dc7543eb8c80b74f3359e4d3bbce75bd.tar.gz
GREIS: Fixes raw-data test failure on some platforms.
This was observed on OSX 10.5, both x86 and PPC, though with different exact symptoms. It could have appeared on any platform where "opportunistic initialization" was absent. The problem is that some of the raw.meas fields are never populated at all by the GREIS driver, but are still converted to JSON, with not-entirely-predictable results, and hence test failures. In the x86 case, "snr" was the offender, while on PPC it was "freqid" and "lli". This fix initializes all the fields of the 'meas' substructure that are otherwise unwritten by this driver. It did not change the output in the previously passing cases. TESTED: All tests now pass on OSX 10.5-10.13, including 10.5 PPC.
Diffstat (limited to 'driver_greis.c')
-rw-r--r--driver_greis.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/driver_greis.c b/driver_greis.c
index 7d1b4083..0392f87e 100644
--- a/driver_greis.c
+++ b/driver_greis.c
@@ -416,6 +416,13 @@ static gps_mask_t greis_msg_SI(struct gps_device_t *session,
session->gpsdata.skyview[i].svid;
/* GREIS does not report locktime, so assume max */
session->gpsdata.raw.meas[i].locktime = LOCKMAX;
+ /* Make sure the unused raw fields are set consistently */
+ session->gpsdata.raw.meas[i].sigid = 0;
+ session->gpsdata.raw.meas[i].snr = 0;
+ session->gpsdata.raw.meas[i].freqid = 0;
+ session->gpsdata.raw.meas[i].lli = 0;
+ session->gpsdata.raw.meas[i].codephase = NAN;
+ session->gpsdata.raw.meas[i].deltarange = NAN;
}
session->driver.greis.seen_si = true;