From 1cd4244859d0e65292505109083ab7e415caab2e Mon Sep 17 00:00:00 2001 From: Serhii Voloshynov Date: Wed, 9 Dec 2020 16:15:44 +0200 Subject: add GLL and VTG to 'gpspipe -r' in binamry mode --- .../gpsd/gpsd-3.20/0007-add-gll-vtg.patch | 73 ++++++++++++++++++++++ recipes-navigation/gpsd/gpsd_3.20.bb | 1 + 2 files changed, 74 insertions(+) create mode 100644 recipes-navigation/gpsd/gpsd-3.20/0007-add-gll-vtg.patch (limited to 'recipes-navigation') diff --git a/recipes-navigation/gpsd/gpsd-3.20/0007-add-gll-vtg.patch b/recipes-navigation/gpsd/gpsd-3.20/0007-add-gll-vtg.patch new file mode 100644 index 0000000..09f20b4 --- /dev/null +++ b/recipes-navigation/gpsd/gpsd-3.20/0007-add-gll-vtg.patch @@ -0,0 +1,73 @@ +From c8a23e6f4223ce1bba8b5863943c7bf5fe88383c Mon Sep 17 00:00:00 2001 +From: Serhii Voloshynov +Date: Wed, 9 Dec 2020 15:28:05 +0200 +Subject: [PATCH] add GLL and VTG to 'gpspipe -r' output in binary mode + +--- + pseudonmea.c | 36 ++++++++++++++++++++++++++++++++++++ + 1 file changed, 36 insertions(+) + +diff --git a/pseudonmea.c b/pseudonmea.c +index 444be3d..c789adb 100644 +--- a/pseudonmea.c ++++ b/pseudonmea.c +@@ -168,6 +168,21 @@ void gpsd_position_fix_dump(struct gps_device_t *session, + * Differential base station ID */ + (void)strlcat(bufp, ",", len); + nmea_add_checksum(bufp); ++ //$GNGGA,103527.00,4957.22994,N,03618.97862,E,1,12,0.89,180.3,M,17.0,M,,*4B ++ //$GNGLL,4957.22997,N,03618.97858,E,103526.00,A,A*7B ++ char *bufgll = &bufp[strlen(bufp)]; ++ (void)snprintf(bufgll, len, ++ "$GPGLL,%s,%c,%s,%c,%s,%c,A,", ++ degtodm_str(session->gpsdata.fix.latitude, "%09.4f", ++ lat_str), ++ ((session->gpsdata.fix.latitude > 0) ? 'N' : 'S'), ++ degtodm_str(session->gpsdata.fix.longitude, "%010.4f", ++ lon_str), ++ ((session->gpsdata.fix.longitude > 0) ? 'E' : 'W'), ++ time_str, ++ fixquality == FIX_QUALITY_INVALID?'V':'A' ++ ); ++ nmea_add_checksum(bufgll); + } + } + +@@ -180,6 +195,7 @@ static void gpsd_transit_fix_dump(struct gps_device_t *session, + char lat_str[BUF_SZ]; + char lon_str[BUF_SZ]; + char speed_str[BUF_SZ]; ++ char kspeed_str[BUF_SZ]; + char track_str[BUF_SZ]; + char var_str[BUF_SZ]; + char *var_dir = ""; +@@ -219,6 +235,26 @@ static void gpsd_transit_fix_dump(struct gps_device_t *session, + time2_str, + var_str, var_dir); + nmea_add_checksum(bufp); ++ //$GNRMC,114740.00,A,4957.22826,N,03618.97015,E,0.054,,091220,,,A*65 ++ //$GNVTG,,T,,M,0.054,N,0.100,K,A*3D ++ //1 = Track made good ++ //2 = Fixed text 'T' indicates that track made good is relative to true north ++ //3 = Track made good, degrees Magnetic ++ //4 = Magnetic track indicator - 'M' ++ //5 = Speed over ground in knots ++ //6 = Fixed text 'N' indicates that speed over ground in in knots ++ //7 = Speed over ground in kilometers/hour ++ //8 = Fixed text 'K' indicates that speed over ground is in kilometers/hour ++ char *bufvtg = &bufp[strlen(bufp)]; ++ (void)snprintf(bufvtg, len, ++ "$GPVTG,%s,T,%s,M,%s,N,%s,K,A,", ++ f_str(session->gpsdata.fix.track, "%.3f", track_str), ++ track_str,//it is not Magnetic track, but may be it is enough ++ f_str(session->gpsdata.fix.speed * MPS_TO_KNOTS, "%.4f", ++ kspeed_str), ++ f_str(session->gpsdata.fix.speed, "%.4f", speed_str) ++ ); ++ nmea_add_checksum(bufvtg); + } + + static void gpsd_binary_satellite_dump(struct gps_device_t *session, +-- +2.7.4 + diff --git a/recipes-navigation/gpsd/gpsd_3.20.bb b/recipes-navigation/gpsd/gpsd_3.20.bb index 5793f46..5f5163f 100644 --- a/recipes-navigation/gpsd/gpsd_3.20.bb +++ b/recipes-navigation/gpsd/gpsd_3.20.bb @@ -18,6 +18,7 @@ SRC_URI = "${SAVANNAH_GNU_MIRROR}/${BPN}/${BP}.tar.gz \ file://0002-SConstruct-fix.patch \ file://0006-ubxtimelps.patch \ file://0006-itu_r_tf_460_6.patch \ + file://0007-add-gll-vtg.patch \ file://gpsd-default \ file://gpsd \ file://gpsd_ubx_fixed.sh \ -- cgit v1.2.3