aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-07-12 06:24:15 -0700
committerAnton Tananaev <anton@traccar.org>2023-07-12 06:24:15 -0700
commitb3c6e22fc19ceeceb0f318131538b5e1d260450c (patch)
treea2edfaf654f6ab0fe902431b9f0983cd9faf8fa6
parentb5d5ec43181a428741c312462024d17ff7fbc676 (diff)
downloadtrackermap-server-b3c6e22fc19ceeceb0f318131538b5e1d260450c.tar.gz
trackermap-server-b3c6e22fc19ceeceb0f318131538b5e1d260450c.tar.bz2
trackermap-server-b3c6e22fc19ceeceb0f318131538b5e1d260450c.zip
Ignore R31 alarm extension
-rw-r--r--src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java5
-rw-r--r--src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
index 5db06fc41..383d4cb3a 100644
--- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -828,7 +828,10 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
} else {
position.set(Position.KEY_BATTERY_LEVEL, buf.readUnsignedByte() * 100 / 6);
position.set(Position.KEY_RSSI, buf.readUnsignedByte());
- position.set(Position.KEY_ALARM, decodeAlarm(buf.readUnsignedByte()));
+ short alarmExtension = buf.readUnsignedByte();
+ if (variant != Variant.VXT01) {
+ position.set(Position.KEY_ALARM, decodeAlarm(alarmExtension));
+ }
}
}
diff --git a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
index 04f41a5ee..fac92d70f 100644
--- a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
@@ -18,7 +18,7 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest {
"78780D01086471700328358100093F040D0A"));
verifyAttribute(decoder, binary(
- "78782416160501000221c0027c5e180c2b9c8d00150301cc002503002bde20050f01000004bd320d0a"),
+ "7878241617070a150e24ca01fba0040780e177005c0001720253360027db6204e40400004bf1e90d0a"),
Position.KEY_ALARM, Position.ALARM_SOS);
verifyAttribute(decoder, binary(