From f182ae04a9857e13482421957140e1a70af2302b Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 4 Aug 2017 00:40:48 +1200 Subject: Improve VT400 protocol decoder --- src/org/traccar/protocol/Vt200ProtocolDecoder.java | 2 +- test/org/traccar/protocol/Vt200ProtocolDecoderTest.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/org/traccar/protocol/Vt200ProtocolDecoder.java b/src/org/traccar/protocol/Vt200ProtocolDecoder.java index f9683f12f..111c29313 100644 --- a/src/org/traccar/protocol/Vt200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Vt200ProtocolDecoder.java @@ -57,7 +57,7 @@ public class Vt200ProtocolDecoder extends BaseProtocolDecoder { int type = buf.readUnsignedShort(); buf.readUnsignedShort(); // length - if (type == 0x2084 || type == 0x2082) { + if (type == 0x2086 || type == 0x2084 || type == 0x2082) { Position position = new Position(); position.setProtocol(getProtocolName()); diff --git a/test/org/traccar/protocol/Vt200ProtocolDecoderTest.java b/test/org/traccar/protocol/Vt200ProtocolDecoderTest.java index 19155af5a..37d9c46d9 100644 --- a/test/org/traccar/protocol/Vt200ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Vt200ProtocolDecoderTest.java @@ -11,13 +11,13 @@ public class Vt200ProtocolDecoderTest extends ProtocolTest { Vt200ProtocolDecoder decoder = new Vt200ProtocolDecoder(new Vt200Protocol()); verifyNull(decoder, binary( - "286310373094563082002701033d00010817143327c68a14841e00c27f550e9a000000000c000000084700200120007d01af260b29")); + "286310373094563082002701033d010817143327c68a14841e00c27f550e9a000000000c000000084700200120007d01af260b29")); - verifyNull(decoder, binary( - "286310373094562086002101033d0001081714333d15441790420114817637207d090a00000847002001207f00d6f229")); + verifyPosition(decoder, binary( + "286310373094562086002101033d010817143328441790420114817637207d090a00000847002001207f00d6f229")); - verifyNull(decoder, binary( - "286310373094562086002101033d000108171433354417932101148139772c9d080a00000847002001207f00dc6729")); + verifyPosition(decoder, binary( + "286310373094562086002101033d0108171433354417932101148139772c9d080a00000847002001207f00dc6729")); verifyNull(decoder, binary( "2863103730945600880012180108171433004418103801148375470000dd29")); -- cgit v1.2.3