From 52e3a5b3aff552a290b86cfd17269b8bae34fea2 Mon Sep 17 00:00:00 2001 From: wb2osz Date: Thu, 31 Dec 2020 14:42:27 -0500 Subject: [PATCH] Display speed and altitude in both metric and Imperial units. --- src/decode_aprs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/decode_aprs.c b/src/decode_aprs.c index 608ab18..29723a6 100644 --- a/src/decode_aprs.c +++ b/src/decode_aprs.c @@ -556,10 +556,10 @@ void decode_aprs_print (decode_aprs_t *A) { }; if (A->g_speed_mph != G_UNKNOWN) { - char spd[20]; + char spd[32]; if (strlen(stemp) > 0) strlcat (stemp, ", ", sizeof(stemp)); - snprintf (spd, sizeof(spd), "%.0f MPH", A->g_speed_mph); + snprintf (spd, sizeof(spd), "%.0f km/h (%.0f MPH)", DW_MILES_TO_KM(A->g_speed_mph), A->g_speed_mph); strlcat (stemp, spd, sizeof(stemp)); }; @@ -572,10 +572,10 @@ void decode_aprs_print (decode_aprs_t *A) { }; if (A->g_altitude_ft != G_UNKNOWN) { - char alt[20]; + char alt[32]; if (strlen(stemp) > 0) strlcat (stemp, ", ", sizeof(stemp)); - snprintf (alt, sizeof(alt), "alt %.0f ft", A->g_altitude_ft); + snprintf (alt, sizeof(alt), "alt %.0f m (%.0f ft)", DW_FEET_TO_METERS(A->g_altitude_ft), A->g_altitude_ft); strlcat (stemp, alt, sizeof(stemp)); };