From 79df808d5d9145d0b81ec9040d6bd3c98c60cbd1 Mon Sep 17 00:00:00 2001 From: wb2osz Date: Sat, 24 Nov 2018 17:20:45 -0500 Subject: [PATCH] Issue 151 - Add support for Multi-GNSS NMEA sentences. --- decode_aprs.c | 6 ++++-- dwgpsnmea.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/decode_aprs.c b/decode_aprs.c index 35c186b..3b7f6c8 100644 --- a/decode_aprs.c +++ b/decode_aprs.c @@ -920,14 +920,16 @@ static void aprs_ll_pos_time (decode_aprs_t *A, unsigned char *info, int ilen) static void aprs_raw_nmea (decode_aprs_t *A, unsigned char *info, int ilen) { - if (strncmp((char*)info, "$GPRMC,", 7) == 0) + if (strncmp((char*)info, "$GPRMC,", 7) == 0 || + strncmp((char*)info, "$GNRMC,", 7) == 0) { float speed_knots = G_UNKNOWN; (void) dwgpsnmea_gprmc ((char*)info, A->g_quiet, &(A->g_lat), &(A->g_lon), &speed_knots, &(A->g_course)); A->g_speed_mph = DW_KNOTS_TO_MPH(speed_knots); } - else if (strncmp((char*)info, "$GPGGA,", 7) == 0) + else if (strncmp((char*)info, "$GPGGA,", 7) == 0 || + strncmp((char*)info, "$GNGGA,", 7) == 0) { float alt_meters = G_UNKNOWN; int num_sat = 0; diff --git a/dwgpsnmea.c b/dwgpsnmea.c index 6ce6963..bdd38df 100644 --- a/dwgpsnmea.c +++ b/dwgpsnmea.c @@ -274,7 +274,8 @@ static void * read_gpsnmea_thread (void *arg) /* Process sentence. */ - if (strncmp(gps_msg, "$GPRMC", 6) == 0) { + if (strncmp(gps_msg, "$GPRMC", 6) == 0 || + strncmp(gps_msg, "$GNRMC", 6) == 0) { f = dwgpsnmea_gprmc (gps_msg, 0, &info.dlat, &info.dlon, &info.speed_knots, &info.track); @@ -318,7 +319,8 @@ static void * read_gpsnmea_thread (void *arg) } } - else if (strncmp(gps_msg, "$GPGGA", 6) == 0) { + else if (strncmp(gps_msg, "$GPGGA", 6) == 0 || + strncmp(gps_msg, "$GNGGA", 6) == 0) { int nsat; f = dwgpsnmea_gpgga (gps_msg, 0, &info.dlat, &info.dlon, &info.altitude, &nsat);