summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lawrence <lordsutch@gmail.com>2017-12-11 00:45:28 -0500
committerGary E. Miller <gem@rellim.com>2018-06-15 19:53:51 -0700
commitb134c67bb31512e6ed40dfabbea26d06025707ad (patch)
treeb91627ae80525d8367fe484491bdbefa2be89e1d
parentb38090a3be832e39de32466d39985ea6210efe81 (diff)
downloadgpsd-b134c67bb31512e6ed40dfabbea26d06025707ad.tar.gz
Fix time display of UBX messages.
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: Gary E. Miller <gem@rellim.com>
-rw-r--r--monitor_ubx.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/monitor_ubx.c b/monitor_ubx.c
index 30eb8473..0c7b5d1c 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);