From 621088cc180926d8341dc97e876187f76d1a36fe Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Mon, 12 May 2014 20:04:53 +0200 Subject: gps: Report speed in meters per second Signed-off-by: Paul Kocialkowski --- gps/nmea.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gps/nmea.c b/gps/nmea.c index b8d6338..a2a5059 100644 --- a/gps/nmea.c +++ b/gps/nmea.c @@ -510,9 +510,13 @@ int gta04_gps_nmea_gprmc(char *nmea) gta04_gps_nmea_coordinates(nmea); buffer = gta04_gps_nmea_parse(nmea); - if (buffer != NULL) + if (buffer != NULL) { speed = gta04_gps_nmea_parse_float(buffer, 0, strlen(buffer)); + // Convert knots (nautical miles per hour) to meters per second + speed = speed * 1.852f / 3.6f; + } + buffer = gta04_gps_nmea_parse(nmea); if (buffer != NULL) bearing = gta04_gps_nmea_parse_float(buffer, 0, strlen(buffer)); -- cgit v1.1