diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-08-04 00:40:48 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-08-04 00:40:48 +1200 |
commit | f182ae04a9857e13482421957140e1a70af2302b (patch) | |
tree | ea209cc15ff571a2e354298b1165cc0da2ba8695 | |
parent | c6760e2ca84a0118c1439a6cbee0da42ed4a1c92 (diff) | |
download | trackermap-server-f182ae04a9857e13482421957140e1a70af2302b.tar.gz trackermap-server-f182ae04a9857e13482421957140e1a70af2302b.tar.bz2 trackermap-server-f182ae04a9857e13482421957140e1a70af2302b.zip |
Improve VT400 protocol decoder
-rw-r--r-- | src/org/traccar/protocol/Vt200ProtocolDecoder.java | 2 | ||||
-rw-r--r-- | 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")); |