aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-04-18 02:49:43 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-04-18 02:49:43 +1200
commit4a5eece13341722fbd20d299ce28bbbcdfc146bd (patch)
tree113c13d143e1101f82aef69207c8a50f93432061
parentb8d998875277a59a7d18f71fc725ba32ac61eda3 (diff)
downloadtrackermap-server-4a5eece13341722fbd20d299ce28bbbcdfc146bd.tar.gz
trackermap-server-4a5eece13341722fbd20d299ce28bbbcdfc146bd.tar.bz2
trackermap-server-4a5eece13341722fbd20d299ce28bbbcdfc146bd.zip
Implement Teltonika tachograph driver decoding
-rw-r--r--src/org/traccar/protocol/TeltonikaProtocolDecoder.java10
-rw-r--r--test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java3
2 files changed, 13 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java
index d2069e6c9..3935ebd60 100644
--- a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java
+++ b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java
@@ -141,6 +141,16 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder {
case 80:
position.set("workMode", readValue(buf, length, false));
break;
+ case 129:
+ case 130:
+ case 131:
+ case 132:
+ case 133:
+ case 134:
+ String driver = id == 129 || id == 132 ? "" : position.getString("driver1");
+ position.set("driver" + (id >= 132 ? 2 : 1),
+ driver + buf.readBytes(length).toString(StandardCharsets.US_ASCII).trim());
+ break;
case 179:
position.set(Position.PREFIX_OUT + 1, readValue(buf, length, false) == 1);
break;
diff --git a/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java b/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java
index d62eef4a0..c76247ac1 100644
--- a/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java
@@ -15,6 +15,9 @@ public class TeltonikaProtocolDecoderTest extends ProtocolTest {
"000F313233343536373839303132333435"));
verifyPositions(decoder, false, binary(
+ "00000000000000A708010000016269E7D9A8000A5A0F0A1CBF8F3300880046120000001C0801014F005100550F740073007801790103430000440000426F980B540000000056000045275700000047580000022659000000005D0000000068000003D07100007355870000000288000000008A000045270669584C5241534834336A30304731363538326B3600FFFFFF0000008155412055414430308230303039383236368330303000000000000100008396"));
+
+ verifyPositions(decoder, false, binary(
"0000000000000035080100000161f37c50500020de5ba60ef11450000000000000000006040100b300b400ef000109002000014e0000000000000000010000be52"));
verifyPositions(decoder, false, binary(