aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-07-27 01:32:21 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-07-27 01:32:21 +1200
commit194263a9dc8040ebcbf62c80733aca5097eb3e36 (patch)
tree9168863b0ff76779e251bf496072bd1deb1fddc2
parent234223a179d3f5e390cf8a649158676f8c349e5c (diff)
downloadtraccar-server-194263a9dc8040ebcbf62c80733aca5097eb3e36.tar.gz
traccar-server-194263a9dc8040ebcbf62c80733aca5097eb3e36.tar.bz2
traccar-server-194263a9dc8040ebcbf62c80733aca5097eb3e36.zip
Extend VT200 protocol decoder
-rw-r--r--src/org/traccar/protocol/Vt200ProtocolDecoder.java2
-rw-r--r--test/org/traccar/protocol/Vt200ProtocolDecoderTest.java15
2 files changed, 16 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Vt200ProtocolDecoder.java b/src/org/traccar/protocol/Vt200ProtocolDecoder.java
index b9af11b43..f9683f12f 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) {
+ if (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 e61c5f9f2..d63bf0062 100644
--- a/test/org/traccar/protocol/Vt200ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Vt200ProtocolDecoderTest.java
@@ -10,6 +10,21 @@ public class Vt200ProtocolDecoderTest extends ProtocolTest {
Vt200ProtocolDecoder decoder = new Vt200ProtocolDecoder(new Vt200Protocol());
+ verifyNull(decoder, binary(
+ "28631037309456008e000801042307171804584229"));
+
+ verifyNull(decoder, binary(
+ "28631037309456108800002e29"));
+
+ verifyPosition(decoder, binary(
+ "28631037309456208200210103302307171805444417097301147188170198090f0000073a002000007e00074429"));
+
+ verifyNull(decoder, binary(
+ "286310373094563089001200032f2107171740144417075001147188872c29"));
+
+ verifyNull(decoder, binary(
+ "2863103730945630880062032f862631037309456f222014604362936f21071717373221071717401400a100000cd700000004020d3c8e0000000000000000000000000000000000000000000000000000000000000000000a000000040000000e009700000cc9000000000000e929"));
+
verifyPosition(decoder, binary(
"28631037309456208400340102dc0906171616454415760201144494473f920a0c0000030500200100417c1f383a9d1090510000006a00007000000e00180ee129"));