From b093228c4d419e87ba2e3899882dae79de55e6d9 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 12 Apr 2011 21:48:22 -0400 Subject: Conjectural decode of RTCM3 message 1033. --- driver_rtcm3.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'driver_rtcm3.c') diff --git a/driver_rtcm3.c b/driver_rtcm3.c index 7b7d0c7c..651bf6b7 100644 --- a/driver_rtcm3.c +++ b/driver_rtcm3.c @@ -28,8 +28,10 @@ is correct, as it's identical to 1008 up to where it ends. The 1033 decode was arrived at by looking at an rtcminspect dump and noting that it carries an information superset of the 1008. There are additional -Receiver and Firmware fields we don't know how to decode without access -to an RTCM3 standard at revision 4 or later. +Receiver and Firmware fields we're not certain to decode without access +to an RTCM3 standard at revision 4 or later, but the guess in the code +has been observed to correctly analyze a message with a nonempty Receiver +field. This file is Copyright (c) 2010 by the GPSD project BSD terms apply: see the file COPYING in the distribution root for details. @@ -65,7 +67,7 @@ BSD terms apply: see the file COPYING in the distribution root for details. void rtcm3_unpack( /*@out@*/ struct rtcm3_t *rtcm, char *buf) /* break out the raw bits into the scaled report-structure fields */ { - unsigned int n, n2; + unsigned int n, n2, n3, n4; int bitcount = 0; unsigned int i; signed long temp; @@ -411,6 +413,14 @@ void rtcm3_unpack( /*@out@*/ struct rtcm3_t *rtcm, char *buf) (void)memcpy(rtcm->rtcmtypes.rtcm3_1033.serial, buf + 9 + n, n2); rtcm->rtcmtypes.rtcm3_1033.serial[n2] = '\0'; bitcount += 8 * n2; + n3 = (unsigned long)ugrab(8); + (void)memcpy(rtcm->rtcmtypes.rtcm3_1033.receiver, buf + 10+n+n2, n3); + rtcm->rtcmtypes.rtcm3_1033.receiver[n3] = '\0'; + bitcount += 8 * n3; + n4 = (unsigned long)ugrab(8); + (void)memcpy(rtcm->rtcmtypes.rtcm3_1033.firmware, buf + 11+n+n2+n3, n3); + rtcm->rtcmtypes.rtcm3_1033.firmware[n4] = '\0'; + bitcount += 8 * n4; break; default: -- cgit v1.2.1