summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am16
-rw-r--r--gps.h17
2 files changed, 16 insertions, 17 deletions
diff --git a/Makefile.am b/Makefile.am
index e31432b9..882f3bd1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -474,6 +474,11 @@ rtcm-regress: gpsdecode
diff -ub $${f}.chk test/test.chk; \
done; \
rm test/test.chk
+ @echo "Testing RTCM encoding..."
+ @mkdir -p test
+ @$(srcdir)/gpsdecode -p < $(srcdir)/test/undump.sample > test/undump.test
+ @diff -u $(srcdir)/test/undump.sample test/undump.test
+ @rm test/undump.test
# Rebuild the RTCM regression tests.
rtcm-makeregress: gpsdecode
@@ -481,7 +486,6 @@ rtcm-makeregress: gpsdecode
$(srcdir)/gpsdecode < $${f} > $${f}.chk; \
done
-
# Regression-test the AIVDM decoder.
aivdm-regress: gpsdecode
@echo "Testing AIVDM decoding..."
@@ -520,14 +524,6 @@ geoid-makeregress: test_geoid
@mkdir -p test
$(srcdir)/test_geoid 37.371192 122.014965 >test/geoid.test.chk
-# Test RTCM encoding using passthrough mode.
-undump-regress: gpsdecode
- @echo "Testing RTCM encoding..."
- @mkdir -p test
- @$(srcdir)/gpsdecode -p < $(srcdir)/test/undump.sample > test/undump.test
- @diff -u $(srcdir)/test/undump.sample test/undump.test
- @rm test/undump.test
-
# Regression-test the calendar functions
time-regress: test_mkgmtime
./test_mkgmtime
@@ -552,7 +548,7 @@ bits-regress: test_bits
test_bits
# Do all normal regression tests
-testregress: gps-regress rtcm-regress aivdm-regress packet-regress undump-regress time-regress unpack-regress
+testregress: gps-regress rtcm-regress aivdm-regress packet-regress time-regress unpack-regress json-regress
@echo "Regressions complete."
# We would like "${MAKE} check" to run the regression tests. automake
diff --git a/gps.h b/gps.h
index 856d5bc5..5056aad7 100644
--- a/gps.h
+++ b/gps.h
@@ -114,11 +114,14 @@ struct gps_fix_t {
typedef /*@unsignedintegraltype@*/ uint32_t isgps30bits_t;
#endif /* S_SPLINT_S */
-/* enumerated values for "system" fields */
-#define NAVSYSTEM_UNKNOWN 0
-#define NAVSYSTEM_GPS 1
-#define NAVSYSTEM_GLONASS 2
-#define NAVSYSTEM_GALILEO 3
+/*
+ * Values for "system" fields. Note, the encoding logic is senstive to the
+ * actual values of these; it's not sufficient that they're distinct.
+ */
+#define NAVSYSTEM_GPS 0
+#define NAVSYSTEM_GLONASS 1
+#define NAVSYSTEM_GALILEO 2
+#define NAVSYSTEM_UNKNOWN 3
struct rtcm2_t {
/* header contents */
@@ -150,8 +153,8 @@ struct rtcm2_t {
int system;
int sense;
#define SENSE_INVALID 0
-#define SENSE_LOCAL 1
-#define SENSE_GLOBAL 2
+#define SENSE_GLOBAL 1
+#define SENSE_LOCAL 2
char datum[6];
double dx, dy, dz;
} reference;