[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gpsd-dev] [PATCH 1/3] Fix time display of UBX messages.
From: |
Chris Lawrence |
Subject: |
[gpsd-dev] [PATCH 1/3] Fix time display of UBX messages. |
Date: |
Mon, 11 Dec 2017 00:45:28 -0500 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
This is the first of three patches to gpsd I've produced while
debugging issues with my u-blox GPS devices.
This patch fixes an order-of-magnitude error in the interpretation of
the GPS time reported by the device (UBX-NAV-SOL) in gpsmon. Verified
to work correctly with both a NEO-M8N and NEO-6N in u-blox (binary)
mode.
Signed-off-by: Chris Lawrence <address@hidden>
---
monitor_ubx.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/monitor_ubx.c b/monitor_ubx.c
index 2ba82de8..35026349 100644
--- a/monitor_ubx.c
+++ b/monitor_ubx.c
@@ -173,16 +173,16 @@ static void display_nav_sol(unsigned char *buf, size_t
data_len)
(void)wmove(navsolwin, 7, 7);
{
- unsigned int day = tow / 8640000;
- unsigned int tod = tow % 8640000;
- unsigned int h = tod / 360000;
- unsigned int m = tod % 360000;
- unsigned int s = m % 6000;
+ unsigned int day = tow / 86400000;
+ unsigned int tod = tow % 86400000;
+ unsigned int h = tod / 3600000;
+ unsigned int m = tod % 3600000;
+ unsigned int s = m % 60000;
- m = (m - s) / 6000;
+ m = (m - s) / 60000;
(void)wattrset(navsolwin, A_UNDERLINE);
- (void)wprintw(navsolwin, "%u %02u:%02u:%05.2f", day, h, m, (double)s /
100);
+ (void)wprintw(navsolwin, "%u %02u:%02u:%05.2f", day, h, m, (double)s /
1000);
(void)wattrset(navsolwin, A_NORMAL);
}
(void)wmove(navsolwin, 8, 11);
--
2.14.3 (Apple Git-98)
--
Chris Lawrence <address@hidden> - http://blog.lordsutch.com/
- [gpsd-dev] [PATCH 1/3] Fix time display of UBX messages.,
Chris Lawrence <=