From fd1cd578d6ba9fa13aadceb59a9b46345108583b Mon Sep 17 00:00:00 2001 From: Sascha Wessel Date: Sun, 28 Sep 2008 13:15:51 +0200 Subject: [PATCH] Fixed speed for frameworkd 2008-09-28 and newer framework commit: daf0729351631f93f9f2f22af33d46658c6f5d68 --- ChangeLog | 4 ++++ fso-gpsd.c | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0686301..b1bf3e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +fso-gpsd 0.7 +* Fixed speed for frameworkd 2008-09-28 and newer + framework commit: daf0729351631f93f9f2f22af33d46658c6f5d68 + fso-gpsd 0.6 (2008-09-18) * Fixed a possible race condition * Fixed GPS resource usage diff --git a/fso-gpsd.c b/fso-gpsd.c index c7af4a6..20bdbde 100644 --- a/fso-gpsd.c +++ b/fso-gpsd.c @@ -34,7 +34,8 @@ #include #include -#define KNOTS (1.852) +#define KNOTS_TO_KPH (1.852) +#define KNOTS_TO_MPS (0.51444444) /******************************************************************************/ @@ -396,7 +397,7 @@ update_nmea_rmc(void) g_string_append_c(nmea_rmc, ','); } else { g_string_append_printf(nmea_rmc, ",%07.3f", - course_speed / KNOTS); + course_speed); } if (isnan(course_direction)) { @@ -461,7 +462,7 @@ update_nmea_vtg(void) g_string_append(nmea_vtg, ",,,,"); } else { g_string_append_printf(nmea_vtg, ",%05.3f,N,%05.3f,K", - course_speed / KNOTS, course_speed); + course_speed, course_speed * KNOTS_TO_KPH); } add_nmea_checksum(nmea_vtg); @@ -663,7 +664,7 @@ add_info(GString *string) g_string_append(string, " ?"); } else { g_string_append_printf(string, " %.3f", - course_speed / (KNOTS * 2)); + course_speed * KNOTS_TO_MPS); } if (isnan(course_climb)) { g_string_append(string, " ?"); @@ -1470,7 +1471,7 @@ read_from_client(GIOChannel *source, GIOCondition condition, gpointer data) g_string_append(reply, ",V=?"); } else { g_string_append_printf(reply, ",V=%.3f", - course_speed / (KNOTS * 2)); + course_speed * KNOTS_TO_MPS); } break; case 'W': -- 2.11.4.GIT