Skip to content

Commit

Permalink
Improve VT400 protocol decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Aug 3, 2017
1 parent c6760e2 commit f182ae0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/org/traccar/protocol/Vt200ProtocolDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected Object decode(
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());
Expand Down
10 changes: 5 additions & 5 deletions test/org/traccar/protocol/Vt200ProtocolDecoderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ public void testDecode() throws Exception {
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"));
Expand Down

0 comments on commit f182ae0

Please sign in to comment.