summaryrefslogtreecommitdiff
path: root/driver_geostar.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2014-09-22 14:50:03 -0400
committerEric S. Raymond <esr@thyrsus.com>2014-09-22 14:50:03 -0400
commit282691da60ec526772f713a63fa0b8f43aea7acb (patch)
tree622f4d55c882f63475b84691d41108dd17326cca /driver_geostar.c
parentf63bdafc18991624b872e9efa858c024834a540e (diff)
downloadgpsd-282691da60ec526772f713a63fa0b8f43aea7acb.tar.gz
Refactor representation of satellite data into an array of structs...
...from a set of parallel arrays. This change flushed out a longstanding bug in the computation of DOPs for estimated error bars. Some test-load rebuilds were required: geostar-geos1m-binary.log.chk: With this change error estimates are computed and reported. trimble-lassen_iq-3dfix.log, trimble-lassen_iq-3dfix.log: the change revealed a bug in the computation of satellite-seen bits. Error estimates did not change. navcom.log: Error estimates changed. With these rebuilds, all regression tests pass.
Diffstat (limited to 'driver_geostar.c')
-rw-r--r--driver_geostar.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/driver_geostar.c b/driver_geostar.c
index 4fc9ebb5..9a778d90 100644
--- a/driver_geostar.c
+++ b/driver_geostar.c
@@ -123,7 +123,7 @@ static bool geostar_detect(struct gps_device_t *session)
static gps_mask_t geostar_analyze(struct gps_device_t *session)
{
- int i, j, len;
+ int i, len;
gps_mask_t mask = 0;
unsigned int id;
int16_t s1, s2, s3;
@@ -259,20 +259,18 @@ static gps_mask_t geostar_analyze(struct gps_device_t *session)
gpsd_report(&session->context->errout, LOG_INF, "SVs in view %d\n", ul1);
session->gpsdata.satellites_visible = (int)ul1;
if(ul1 > GEOSTAR_CHANNELS) ul1 = GEOSTAR_CHANNELS;
- for(i = 0, j = 0; (uint32_t)i < ul1; i++) {
+ for(i = 0; (uint32_t)i < ul1; i++) {
ul2 = getleu32(buf, OFFSET(2) + i * 3 * 4);
s1 = getles16(buf, OFFSET(3) + i * 3 * 4);
s2 = getles16(buf, OFFSET(3) + 2 + i * 3 * 4);
s3 = getles16(buf, OFFSET(4) + 2 + i * 3 * 4);
gpsd_report(&session->context->errout, LOG_INF, "ID %d Az %g El %g SNR %g\n",
decode_channel_id(ul2), s1*0.001*RAD_2_DEG, s2*0.001*RAD_2_DEG, s3*0.1);
- session->gpsdata.PRN[i] = decode_channel_id(ul2);
- session->gpsdata.azimuth[i] = (int)round((double)s1*0.001 * RAD_2_DEG);
- session->gpsdata.elevation[i] = (int)round((double)s2*0.001 * RAD_2_DEG);
- session->gpsdata.ss[i] = (double)s3*0.1;
- if(ul2 & (1<<27)) {
- session->gpsdata.used[j++] = decode_channel_id(ul2);
- }
+ session->gpsdata.skyview[i].PRN = decode_channel_id(ul2);
+ session->gpsdata.skyview[i].azimuth = (int)round((double)s1*0.001 * RAD_2_DEG);
+ session->gpsdata.skyview[i].elevation = (int)round((double)s2*0.001 * RAD_2_DEG);
+ session->gpsdata.skyview[i].ss = (double)s3*0.1;
+ session->gpsdata.skyview[i].used = (bool)(ul2 & (1<<27));
}
session->gpsdata.skyview_time = NAN;
mask |= SATELLITE_SET | USED_IS;