From b3c6e22fc19ceeceb0f318131538b5e1d260450c Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 12 Jul 2023 06:24:15 -0700 Subject: Ignore R31 alarm extension --- src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java | 5 ++++- src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') 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( -- cgit v1.2.3