aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-06-09 23:11:21 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-06-09 23:11:21 -0700
commita796c0317dc8c0598adb757eb6a77358c90767c3 (patch)
tree5ec7dd93cc7ecca0ce591d5f791ea4dd3dde053a /src
parent7dc90b43ee9ca04d317e7d8f45beab915550adfb (diff)
downloadtrackermap-server-a796c0317dc8c0598adb757eb6a77358c90767c3.tar.gz
trackermap-server-a796c0317dc8c0598adb757eb6a77358c90767c3.tar.bz2
trackermap-server-a796c0317dc8c0598adb757eb6a77358c90767c3.zip
Support JT600 protocol for JT701
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java3
-rw-r--r--src/test/java/org/traccar/protocol/Jt600ProtocolDecoderTest.java3
2 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java
index 1351706e2..da055dff3 100644
--- a/src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 - 2018 Anton Tananaev (anton@traccar.org)
+ * Copyright 2012 - 2019 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.
@@ -170,6 +170,7 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder {
if (protocolVersion == 0x17) {
buf.readUnsignedByte(); // geofence id
buf.skipBytes(3); // reserved
+ buf.skipBytes(buf.readableBytes() - 1);
}
} else if (version == 1) {
diff --git a/src/test/java/org/traccar/protocol/Jt600ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Jt600ProtocolDecoderTest.java
index 1ffa2a429..718000a44 100644
--- a/src/test/java/org/traccar/protocol/Jt600ProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/Jt600ProtocolDecoderTest.java
@@ -12,6 +12,9 @@ public class Jt600ProtocolDecoderTest extends ProtocolTest {
Jt600ProtocolDecoder decoder = new Jt600ProtocolDecoder(null);
verifyPositions(decoder, binary(
+ "2475810297431713003401010000030100000000000000000e000000000001000000000020e0641aba1b6f1b00000f0f0f0f0f0f0f0f0f0f000001942803"));
+
+ verifyPositions(decoder, binary(
"2440811188882400A209060908045322564025113242329F0598000001003F0000002D0009060908050322564025113242329F0598000001003F0000002D0009060908051322564025113242329F0598000001003F0000002D0009060908052322564025113242329F0598000001003F0000002D0009060908053322564025113242329F0598000001003F0000002D0009060908054322564025113242329F0598000001003F0000002D001F"));
verifyPositions(decoder, binary(