summaryrefslogtreecommitdiff
path: root/driver_nmea0183.c
diff options
context:
space:
mode:
authorChris Lawrence <lordsutch@gmail.com>2017-12-11 01:12:14 -0500
committerGary E. Miller <gem@rellim.com>2018-06-15 21:00:00 -0700
commitaed938aacb07f304265c36638b081b0d65007bd5 (patch)
treeb5308527f670735dba366922080eb071988f3b1d /driver_nmea0183.c
parent648ccd2a9d3eb2fa2f88f2116a84b2e5ac6278b1 (diff)
downloadgpsd-aed938aacb07f304265c36638b081b0d65007bd5.tar.gz
Support Galileo $GA... talkers and fix a couple of $GB cases
Now that the Galileo constellation is live, the NMEA 4.1 standard appears to have standardized on the "$GA..." prefix for Galileo-specific messages. The lexer currently filters these out; this patch ensures they go through to e.g. gpspipe -r. (I tore my hair out for days trying to figure out why these were not being passed through even though I could see them using screen etc.) Also added logic to the GSA and GSV message parsing to account for the Galileo messages. It probably needs more work to match up satellite numbers between the GSA and GSV messages and to account for the GNSS type field in NMEA 4.1, but it's a start at least. I also fixed a couple of situations where the 'GB' prefix was being ignored even though 'BD' was not. This leads to a regression in test/daemon/beidou-gb.log, but the "regression" is actually incorrect old behavior (JSON messages omitting BeiDou satellites) exposed by the patch. Signed-off-by: Gary E. Miller <gem@rellim.com>
Diffstat (limited to 'driver_nmea0183.c')
-rw-r--r--driver_nmea0183.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/driver_nmea0183.c b/driver_nmea0183.c
index ba3ddfd5..235d76e8 100644
--- a/driver_nmea0183.c
+++ b/driver_nmea0183.c
@@ -615,6 +615,8 @@ static int nmeaid_to_prn(char *talker, int satnum)
/* QZSS */
if (talker[0] == 'Q' && talker[1] == 'Z')
satnum += 193;
+ if (talker[0] == 'G' && talker[1] == 'A')
+ satnum += 300; /* Used by u-blox at least */
}
return satnum;
@@ -708,12 +710,15 @@ static gps_mask_t processGSA(int count, char *field[],
memset(session->nmea.sats_used, 0, sizeof(session->nmea.sats_used));
}
session->nmea.last_gsa_talker = GSA_TALKER;
- if (session->nmea.last_gsa_talker == 'D')
+ if ((session->nmea.last_gsa_talker == 'D')
+ || (session->nmea.last_gsa_talker == 'B'))
session->nmea.seen_bdgsa = true;
else if (session->nmea.last_gsa_talker == 'L')
session->nmea.seen_glgsa = true;
else if (session->nmea.last_gsa_talker == 'N')
session->nmea.seen_gngsa = true;
+ else if (session->nmea.last_gsa_talker == 'A')
+ session->nmea.seen_gagsa = true;
/* the magic 6 here counts the tag, two mode fields, and DOP fields */
for (i = 0; i < count - 6; i++) {
@@ -744,7 +749,7 @@ static gps_mask_t processGSA(int count, char *field[],
}
/* assumes GLGSA or BDGSA, if present, is emitted directly
* after the GPGSA*/
- if ((session->nmea.seen_glgsa || session->nmea.seen_bdgsa)
+ if ((session->nmea.seen_glgsa || session->nmea.seen_bdgsa || session->nmea.seen_gagsa)
&& GSA_TALKER == 'P')
return ONLINE_SET;
@@ -849,10 +854,12 @@ static gps_mask_t processGSV(int count, char *field[],
session->nmea.last_gsv_talker = GSV_TALKER;
if (session->nmea.last_gsv_talker == 'L')
session->nmea.seen_glgsv = true;
- if (session->nmea.last_gsv_talker == 'D')
+ if (session->nmea.last_gsv_talker == 'D' || session->nmea.last_gsv_talker == 'B')
session->nmea.seen_bdgsv = true;
if (session->nmea.last_gsv_talker == 'Z')
session->nmea.seen_qzss = true;
+ if (session->nmea.last_gsv_talker == 'A')
+ session->nmea.seen_gagsv = true;
}
for (fldnum = 4; fldnum < count / 4 * 4;) {
@@ -896,13 +903,12 @@ static gps_mask_t processGSV(int count, char *field[],
* FIXME: Add per-talker totals so we can do this check properly.
*/
if (!(session->nmea.seen_glgsv || session->nmea.seen_bdgsv
- || session->nmea.seen_qzss)) {
+ || session->nmea.seen_qzss || session->nmea.seen_gagsv))
if (session->nmea.part == session->nmea.await
&& atoi(field[3]) != session->gpsdata.satellites_visible)
gpsd_log(&session->context->errout, LOG_WARN,
"GPGSV field 3 value of %d != actual count %d\n",
atoi(field[3]), session->gpsdata.satellites_visible);
- }
/* not valid data until we've seen a complete set of parts */
if (session->nmea.part < session->nmea.await) {
@@ -935,7 +941,8 @@ static gps_mask_t processGSV(int count, char *field[],
/* assumes GLGSV or BDGSV group, if present, is emitted after the GPGSV */
if ((session->nmea.seen_glgsv || session->nmea.seen_bdgsv
- || session->nmea.seen_qzss) && GSV_TALKER == 'P')
+ || session->nmea.seen_qzss || session->nmea.seen_gagsv)
+ && GSV_TALKER == 'P')
return ONLINE_SET;
/* clear computed DOPs so they get recomputed. */