aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-09-24 22:21:43 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-09-24 22:21:43 -0700
commit49a5ac1259f299615e56d5d8e733234a4d7364bd (patch)
treeddfa846cda87ef6f678def52f73cfced9dbfc8f8 /src/main/java/org
parent0410bce8df4f66aec23232caf03100a36527d15b (diff)
downloadtrackermap-server-49a5ac1259f299615e56d5d8e733234a4d7364bd.tar.gz
trackermap-server-49a5ac1259f299615e56d5d8e733234a4d7364bd.tar.bz2
trackermap-server-49a5ac1259f299615e56d5d8e733234a4d7364bd.zip
GPS rollover fix for MXT
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/traccar/protocol/MxtProtocolDecoder.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/MxtProtocolDecoder.java b/src/main/java/org/traccar/protocol/MxtProtocolDecoder.java
index 7bde85f87..c36be9cbf 100644
--- a/src/main/java/org/traccar/protocol/MxtProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/MxtProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 - 2018 Anton Tananaev (anton@traccar.org)
+ * Copyright 2015 - 2021 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -97,6 +97,10 @@ public class MxtProtocolDecoder extends BaseProtocolDecoder {
long date = buf.readUnsignedIntLE();
long days = BitUtil.from(date, 6 + 6 + 5);
+ if (days < 7 * 1024) {
+ days += 7 * 1024;
+ }
+
long hours = BitUtil.between(date, 6 + 6, 6 + 6 + 5);
long minutes = BitUtil.between(date, 6, 6 + 6);
long seconds = BitUtil.to(date, 6);