aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-07-19 06:26:19 -0700
committerAnton Tananaev <anton@traccar.org>2023-07-19 06:26:26 -0700
commit5a1a8d9192ee44b116f10e5ce3551a4e4bc70deb (patch)
tree90f0f656a9ec109b75d1d0a98bc1641b7b71d5ae /src
parenta632bdab0f5a6771ae40260a485c93bdcc853d42 (diff)
downloadtrackermap-server-5a1a8d9192ee44b116f10e5ce3551a4e4bc70deb.tar.gz
trackermap-server-5a1a8d9192ee44b116f10e5ce3551a4e4bc70deb.tar.bz2
trackermap-server-5a1a8d9192ee44b116f10e5ce3551a4e4bc70deb.zip
Fix date decoding
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/T622IridiumProtocolDecoder.java2
-rw-r--r--src/test/java/org/traccar/protocol/T622IridiumProtocolDecoderTest.java5
2 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/protocol/T622IridiumProtocolDecoder.java b/src/main/java/org/traccar/protocol/T622IridiumProtocolDecoder.java
index 27b7baf54..9e64ec9be 100644
--- a/src/main/java/org/traccar/protocol/T622IridiumProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/T622IridiumProtocolDecoder.java
@@ -94,7 +94,7 @@ public class T622IridiumProtocolDecoder extends BaseProtocolDecoder {
position.setLongitude(buf.readIntLE() / 1000000.0);
break;
case 0x04:
- position.setTime(new Date((buf.readUnsignedIntLE() + 946713600) * 1000));
+ position.setTime(new Date((buf.readUnsignedIntLE() + 946684800) * 1000));
break;
case 0x05:
position.setValid(buf.readUnsignedByte() > 0);
diff --git a/src/test/java/org/traccar/protocol/T622IridiumProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/T622IridiumProtocolDecoderTest.java
index 17b252618..ff5d5b0a0 100644
--- a/src/test/java/org/traccar/protocol/T622IridiumProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/T622IridiumProtocolDecoderTest.java
@@ -1,12 +1,10 @@
package org.traccar.protocol;
-import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.traccar.ProtocolTest;
public class T622IridiumProtocolDecoderTest extends ProtocolTest {
- @Disabled
@Test
public void testDecode() throws Exception {
@@ -15,7 +13,8 @@ public class T622IridiumProtocolDecoderTest extends ProtocolTest {
decoder.setFormat("01,02,03,04,05,08");
verifyPosition(decoder, binary(
- "01003301001c2a8cef8333303034333430363735343836353000001700006461d512020011232f03a0fff1c85d0612b3f02b00000048"));
+ "01003501001c68b2cb1733303034333430363735343836353000016e000064b5f497020013234c5ea0ff1c365d0600b1482c010000cf0004"),
+ position("2023-07-18 02:10:08.000", true, -6.26732, 106.77200));
}