summaryrefslogtreecommitdiff
path: root/isgps.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-07-26 17:30:16 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-07-26 17:30:16 +0000
commit36cde1b1078ba2df24ad20f305259b9daca67833 (patch)
treeb3a63b2bc4c152fb848079271864032968b972ff /isgps.c
parent47690cb6367a55832e6d7afc357ceae217be8a88 (diff)
downloadgpsd-36cde1b1078ba2df24ad20f305259b9daca67833.tar.gz
A large step towards automatically syncing with RTCM streams.
It partly works now! All GPS regression tests pass.
Diffstat (limited to 'isgps.c')
-rw-r--r--isgps.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/isgps.c b/isgps.c
index 95e0c643..691b4700 100644
--- a/isgps.c
+++ b/isgps.c
@@ -186,11 +186,13 @@ enum isgpsstat_t isgps_decode(struct gps_device_t *session,
{
enum isgpsstat_t res;
+ /* ASCII characters 64-127, @ through DEL */
if ((c & MAG_TAG_MASK) != MAG_TAG_DATA) {
gpsd_report(RTCM_ERRLEVEL_BASE+1,
"word tag not correct, skipping\n");
return ISGPS_SKIP;
}
+
c = reverse_bits[c & 0x3f];
/*@ -shiftnegative @*/
@@ -199,13 +201,13 @@ enum isgpsstat_t isgps_decode(struct gps_device_t *session,
session->isgps.bufindex = 0;
while (session->isgps.curr_offset <= 0) {
- gpsd_report(RTCM_ERRLEVEL_BASE+2, "syncing\n");
session->isgps.curr_word <<= 1;
if (session->isgps.curr_offset > 0) {
session->isgps.curr_word |= c << session->isgps.curr_offset;
} else {
session->isgps.curr_word |= c >> -(session->isgps.curr_offset);
}
+ gpsd_report(RTCM_ERRLEVEL_BASE+2, "syncing at byte %d: %0x%08x\n", session->counter, session->isgps.curr_word);
if (preamble_match(&session->isgps.curr_word)) {
if (isgpsparityok(session->isgps.curr_word)) {