diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2007-12-28 03:13:44 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2007-12-28 03:13:44 +0000 |
commit | 35515b0d8d0b4594b90d7b6cc9cca218e89ee824 (patch) | |
tree | a367a14d3a083772b3f90000c29338b60af74366 /sirf.c | |
parent | df59e120bc7ecc8e737857e0710d95fc6a68e4ce (diff) | |
download | gpsd-35515b0d8d0b4594b90d7b6cc9cca218e89ee824.tar.gz |
Backed out some recent changes that broke regression tests.
Specifically, the changes to sirf.c from ckuethe to stop
rAte-linmiting satellite messages (27 Dec 2007) and the changes to
packet.c and packet.states.h from ckuethe on 25 Dec 2007 to make the
packet sniffer 'a bit more picky'.
The packet-getter changes need to be re-implemented in a way
that doesn't break the RTCM regression test.
The SiRF changes will break the regression tests, and that's OK, but
they need to be committed along with a rebuild of the tests so
the tests pass after commit.
Diffstat (limited to 'sirf.c')
-rw-r--r-- | sirf.c | 26 |
1 files changed, 19 insertions, 7 deletions
@@ -307,15 +307,29 @@ static gps_mask_t sirf_msg_svinfo(struct gps_device_t *session, unsigned char *b = gpstime_to_unix(getsw(buf, 1), getul(buf, 3)*1e-2) - session->context->leap_seconds; for (i = st = 0; i < SIRF_CHANNELS; i++) { int off = 8 + 15 * i; - session->gpsdata.PRN[i] = (int)getub(buf, off); - session->gpsdata.azimuth[i] = (int)(((unsigned)getub(buf, off+1)*3)/2.0); - session->gpsdata.elevation[i] = (int)((unsigned)getub(buf, off+2)/2.0); + bool good; + session->gpsdata.PRN[st] = (int)getub(buf, off); + session->gpsdata.azimuth[st] = (int)(((unsigned)getub(buf, off+1)*3)/2.0); + session->gpsdata.elevation[st] = (int)((unsigned)getub(buf, off+2)/2.0); cn = 0; for (j = 0; j < 10; j++) cn += (int)getub(buf, off+5+j); - session->gpsdata.ss[i] = cn/10; - st++; + session->gpsdata.ss[st] = cn/10; + good = session->gpsdata.PRN[st]!=0 && + session->gpsdata.azimuth[st]!=0 && + session->gpsdata.elevation[st]!=0; +#ifdef __UNUSED__ + gpsd_report(LOG_PROG, "PRN=%2d El=%3.2f Az=%3.2f ss=%3d stat=%04x %c\n", + getub(buf, off), + getub(buf, off+2)/2.0, + (getub(buf, off+1)*3)/2.0, + cn/10, + getuw(buf, off+3), + good ? '*' : ' '); +#endif /* UNUSED */ + if (good!=0) + st += 1; } session->gpsdata.satellites = st; #ifdef NTPSHM_ENABLE @@ -328,7 +342,6 @@ static gps_mask_t sirf_msg_svinfo(struct gps_device_t *session, unsigned char *b (void)ntpshm_put(session,session->gpsdata.sentence_time+0.8); } #endif /* NTPSHM_ENABLE */ -#ifdef PLEASE_THROW_AWAY_USEFUL_DATA /* * The freaking brain-dead SiRF chip doesn't obey its own * rate-control command for 04, at least at firmware rev. 231, @@ -338,7 +351,6 @@ static gps_mask_t sirf_msg_svinfo(struct gps_device_t *session, unsigned char *b if ((session->driver.sirf.satcounter++ % 5) != 0) return 0; else -#endif return TIME_SET | SATELLITE_SET; } |