aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-07-09 07:32:49 -0700
committerAnton Tananaev <anton@traccar.org>2023-07-09 07:32:49 -0700
commitd2ce5af3478265c6c047f5ec4bf206baebb467d1 (patch)
tree7b86a6a5e60917ec50e720f4050852192118a7bb /src
parent92e90931cd806d4b2f53ff946a19b46595f856e9 (diff)
downloadtrackermap-server-d2ce5af3478265c6c047f5ec4bf206baebb467d1.tar.gz
trackermap-server-d2ce5af3478265c6c047f5ec4bf206baebb467d1.tar.bz2
trackermap-server-d2ce5af3478265c6c047f5ec4bf206baebb467d1.zip
Handle R31 protocol variant
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java6
-rw-r--r--src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java4
2 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
index 38c2219f8..5db06fc41 100644
--- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -806,7 +806,11 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
}
if (hasLbs(type) && buf.readableBytes() > 6) {
- decodeLbs(position, buf, type, hasStatus(type) && type != MSG_LBS_ALARM && type != MSG_LBS_STATUS);
+ boolean hasLength = hasStatus(type)
+ && type != MSG_LBS_STATUS
+ && type != MSG_LBS_ALARM
+ && (type != MSG_GPS_LBS_STATUS_1 || variant != Variant.VXT01);
+ decodeLbs(position, buf, type, hasLength);
}
if (hasStatus(type)) {
diff --git a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
index 937c7eca1..04f41a5ee 100644
--- a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
@@ -18,6 +18,10 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest {
"78780D01086471700328358100093F040D0A"));
verifyAttribute(decoder, binary(
+ "78782416160501000221c0027c5e180c2b9c8d00150301cc002503002bde20050f01000004bd320d0a"),
+ Position.KEY_ALARM, Position.ALARM_SOS);
+
+ verifyAttribute(decoder, binary(
"78780a130604ea04000006bc8a0d0a"),
Position.KEY_POWER, 0.0);