diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-03-01 10:06:05 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-03-01 10:06:05 -0500 |
commit | 1ca627ffdcd428375a6cebb556f516fe5251121d (patch) | |
tree | 8ded5529cebb08b8518d5a88ace974337e388bab /driver_rtcm3.c | |
parent | 75fb682db4b9c5f95550cbaf402526730c5efa33 (diff) | |
download | gpsd-1ca627ffdcd428375a6cebb556f516fe5251121d.tar.gz |
A step towards decoding RTCM3.
Diffstat (limited to 'driver_rtcm3.c')
-rw-r--r-- | driver_rtcm3.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/driver_rtcm3.c b/driver_rtcm3.c index d69cdf33..3ea85689 100644 --- a/driver_rtcm3.c +++ b/driver_rtcm3.c @@ -89,6 +89,9 @@ void rtcm3_unpack( /*@out@*/ struct rtcm3_t *rtcm, char *buf) rtcm->length = (uint)ugrab(10); rtcm->type = (uint)ugrab(12); + gpsd_report(LOG_RAW, "RTCM3: Raw packet type 0x%02x length %d: %s\n", + rtcm->type, rtcm->length, gpsd_hexdump_wrapper(buf, rtcm->length, LOG_RAW)); + switch (rtcm->type) { case 1001: /* GPS Basic RTK, L1 Only */ rtcm->rtcmtypes.rtcm3_1001.header.station_id = (uint)ugrab(12); @@ -423,8 +426,11 @@ void rtcm3_unpack( /*@out@*/ struct rtcm3_t *rtcm, char *buf) break; default: - //memcpy(tp->rtcmtypes.data, msg->msg_type.rtcm2_msgunk, - // (RTCM2_WORDS_MAX - 2) * sizeof(isgps30bits_t)); + /* + * Leader bytes, message length, and checksum won't be copied. + * The first 12 bits of the copied payload will be the type field. + */ + memcpy(rtcm->rtcmtypes.data, buf+3, rtcm->length); break; } #undef RANGEDIFF |