diff options
author | Anton Tananaev <anton@traccar.org> | 2023-07-09 07:32:49 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-07-09 07:32:49 -0700 |
commit | d2ce5af3478265c6c047f5ec4bf206baebb467d1 (patch) | |
tree | 7b86a6a5e60917ec50e720f4050852192118a7bb | |
parent | 92e90931cd806d4b2f53ff946a19b46595f856e9 (diff) | |
download | trackermap-server-d2ce5af3478265c6c047f5ec4bf206baebb467d1.tar.gz trackermap-server-d2ce5af3478265c6c047f5ec4bf206baebb467d1.tar.bz2 trackermap-server-d2ce5af3478265c6c047f5ec4bf206baebb467d1.zip |
Handle R31 protocol variant
-rw-r--r-- | src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java | 6 | ||||
-rw-r--r-- | src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java | 4 |
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); |