diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2014-05-12 20:04:53 +0200 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2014-05-12 20:04:53 +0200 |
commit | 621088cc180926d8341dc97e876187f76d1a36fe (patch) | |
tree | 7f409b6238750c8ab34d361b9773cfc2bb28fc79 | |
parent | 0bcd90da87361c7109d02e02950b5fb87674e10d (diff) | |
download | device_goldelico_gta04-621088cc180926d8341dc97e876187f76d1a36fe.zip device_goldelico_gta04-621088cc180926d8341dc97e876187f76d1a36fe.tar.gz device_goldelico_gta04-621088cc180926d8341dc97e876187f76d1a36fe.tar.bz2 |
gps: Report speed in meters per second
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r-- | gps/nmea.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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)); |