summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gps/nmea.c6
1 files changed, 5 insertions, 1 deletions
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));