summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-07-01 00:21:28 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-07-01 00:21:28 +0000
commit39ba7ffed21fe6f61a7a55d1e520be0c96dd52fb (patch)
tree9287a110b89f9a3662db37b5b4ba683a2e8e25e6
parentbb70204607bd8d2296d9619f45123adda8fcbd42 (diff)
downloadgpsd-39ba7ffed21fe6f61a7a55d1e520be0c96dd52fb.tar.gz
Get the length of an RTCM104 message right.
-rw-r--r--gpsd.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/gpsd.h b/gpsd.h
index 92f6ed5a..23f47b8e 100644
--- a/gpsd.h
+++ b/gpsd.h
@@ -22,6 +22,21 @@
#define NMEA_MAX 82 /* max length of NMEA sentence */
#define NMEA_BIG_BUF (2*NMEA_MAX+1) /* longer than longest NMEA sentence */
+/*
+ * From the RCTM104 standard:
+ *
+ * The 30 bit words (as opposed to 32 bit words) coupled with a 50 Hz
+ * transmission rate provides a convenient timing capability where the
+ * times of word boundaries are a rational multiple of 0.6 seconds."
+ *
+ * Each frame is N+2 words long, where N is the number of message data
+ * words. For example, a filler message (type 6 or 34) with no message
+ * data will have N=0, and will consist only of two header words. The
+ * maximum number of data words allowed by the format is 31, so that
+ * the longest possible message will have a total of 33 words."
+ */
+#define RTCM_MAX 33*sizeof(int32_t)
+
/* only used if the GPS doesn't report estimated position error itself */
#define UERE_NO_DGPS 8 /* meters */
#define UERE_WITH_DGPS 2 /* meters */
@@ -37,7 +52,7 @@ struct gps_context_t {
int fixcnt; /* count of good fixes seen */
int dsock; /* socket to DGPS server */
ssize_t rtcmbytes; /* byte count of last RTCM104 report */
- char rtcmbuf[40]; /* last RTCM104 report */
+ char rtcmbuf[RTCM_MAX]; /* last RTCM104 report */
double rtcmtime; /* timestamp of last RTCM104 report */
/* timekeeping */
int leap_seconds; /* Unix seconds to UTC */