From 1f59156f25a8e23cd2d9bfec7d7ec121539e95d5 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Fri, 14 Aug 2026 14:32:26 +0200 Subject: cleanup --- src/main.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index ed98cb4..7297703 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -39,7 +39,7 @@ read_line(asio::serial_port& com) } string -get_gps_datetime(const minmea_time& time, const minmea_date& date) +get_gps_datetime(const minmea_date& date, const minmea_time& time) { tm tm_utc{}; ::minmea_getdatetime(&tm_utc, &date, &time); @@ -80,13 +80,16 @@ main() continue; } - auto timestamp = get_gps_datetime(frame.time, frame.date); + const auto latitude = ::minmea_tocoord(&frame.latitude); + const auto longitude = ::minmea_tocoord(&frame.longitude); + const auto speed = ::minmea_tofloat(&frame.speed) * KNOTS_TO_KMH; + const auto timestamp = get_gps_datetime(frame.date, frame.time); cout << format("{}: $RMC floating point degree coordinates and speed: ({},{}) {} km/h\n", timestamp, - ::minmea_tocoord(&frame.latitude), - ::minmea_tocoord(&frame.longitude), - ::minmea_tofloat(&frame.speed) * KNOTS_TO_KMH); + latitude, + longitude, + speed); } } catch ( exception& e ) { -- cgit v1.3