From 1ca627ffdcd428375a6cebb556f516fe5251121d Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 1 Mar 2011 10:06:05 -0500 Subject: A step towards decoding RTCM3. --- driver_rtcm3.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'driver_rtcm3.c') 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 -- cgit v1.2.1