From 1b72497a7f44658b8a3e9b27f1c5d1f5bb7a615a Mon Sep 17 00:00:00 2001 From: "Gary E. Miller" Date: Mon, 25 Mar 2019 17:52:42 -0700 Subject: gps_data_t: Add datum field. Add decode for $PGRMM. Sadly, $PGRMM is after a cycle ender and the data is never reported, so no regression changes. Cycle ender needs to get fixed... --- driver_nmea0183.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'driver_nmea0183.c') diff --git a/driver_nmea0183.c b/driver_nmea0183.c index 7732c089..8c07339c 100644 --- a/driver_nmea0183.c +++ b/driver_nmea0183.c @@ -1423,6 +1423,30 @@ static gps_mask_t processPGRME(int c UNUSED, char *field[], return mask; } +/* Garmin Map Datum + * + * FIXME: seems to happen after cycle ender, so nothing happens... + */ +static gps_mask_t processPGRMM(int c UNUSED, char *field[], + struct gps_device_t *session) +{ + /* + * $PGRMM,NAD83*29 + * 1 = Map Datum + */ + gps_mask_t mask = ONLINE_SET; + + if ('\0' != field[1][0]) { + strlcpy(session->newdata.datum, field[1], + sizeof(session->newdata.datum)); + } + + gpsd_log(&session->context->errout, LOG_DATA, + "PGRMM: datum=%.40s\n", + session->newdata.datum); + return mask; +} + /* Garmin Altitude Information */ static gps_mask_t processPGRMZ(int c UNUSED, char *field[], struct gps_device_t *session) @@ -2442,7 +2466,7 @@ gps_mask_t nmea_parse(char *sentence, struct gps_device_t * session) {"PGRMF", 0, false, NULL}, /* ignore Garmin GPS Fix Data */ {"PGRMH", 0, false, NULL}, /* ignore Garmin Aviation Height... */ {"PGRMI", 0, false, NULL}, /* ignore Garmin Sensor Init */ - {"PGRMM", 0, false, NULL}, /* ignore Garmin Map Datum */ + {"PGRMM", 2, false, processPGRMM}, /* Garmin Map Datum */ {"PGRMO", 0, false, NULL}, /* ignore Garmin Sentence Enable */ {"PGRMT", 0, false, NULL}, /* ignore Garmin Sensor Info */ {"PGRMV", 0, false, NULL}, /* ignore Garmin 3D Velocity Info */ @@ -2463,6 +2487,7 @@ gps_mask_t nmea_parse(char *sentence, struct gps_device_t * session) * 4. The mode is changed back to NMEA, resulting in an * infinite loop. */ + {"BOD", 0, false, NULL}, /* ignore Bearing Origin to Destination */ {"DBT", 7, true, processDBT}, {"DTM", 0, false, NULL}, /* ignore datum */ {"GBS", 7, false, processGBS}, @@ -2503,8 +2528,9 @@ gps_mask_t nmea_parse(char *sentence, struct gps_device_t * session) {"STI", 2, false, processSTI}, /* $STI Skytraq */ #endif /* SKYTRAQ_ENABLE */ {"RMC", 8, false, processRMC}, + {"RTE", 0, false, NULL}, /* ignore Routes */ {"TXT", 5, false, processTXT}, - {"VLW", 0, false, NULL}, /* ignore Dual ground/water distance */ + {"VLW", 0, false, NULL}, /* ignore Dual ground/water distance */ {"VTG", 5, false, processVTG}, {"ZDA", 4, false, processZDA}, }; -- cgit v1.2.1