aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-05-03 16:49:11 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-05-03 16:49:11 +1200
commit0d2867eb1d79ee0840c35d1e60860952e44eaab1 (patch)
treeaa7539acbe837cce53118124f8e5961b0c6daa0b
parentff1f4cc5a0ef001b104fb1e36a4e7e660b555910 (diff)
downloadtrackermap-server-0d2867eb1d79ee0840c35d1e60860952e44eaab1.tar.gz
trackermap-server-0d2867eb1d79ee0840c35d1e60860952e44eaab1.tar.bz2
trackermap-server-0d2867eb1d79ee0840c35d1e60860952e44eaab1.zip
Decode Teltonika green driving IO values
-rw-r--r--src/org/traccar/protocol/TeltonikaProtocolDecoder.java23
-rw-r--r--test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java3
2 files changed, 26 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java
index 3935ebd60..230db5dde 100644
--- a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java
+++ b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java
@@ -163,6 +163,29 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder {
case 182:
position.set(Position.KEY_HDOP, readValue(buf, length, false) * 0.1);
break;
+ case 236:
+ if (readValue(buf, length, false) == 1) {
+ position.set(Position.KEY_ALARM, Position.ALARM_OVERSPEED);
+ }
+ break;
+ case 237:
+ position.set(Position.KEY_MOTION, readValue(buf, length, false) == 0);
+ break;
+ case 238:
+ switch ((int) readValue(buf, length, false)) {
+ case 1:
+ position.set(Position.KEY_ALARM, Position.ALARM_ACCELERATION);
+ break;
+ case 2:
+ position.set(Position.KEY_ALARM, Position.ALARM_BRAKING);
+ break;
+ case 3:
+ position.set(Position.KEY_ALARM, Position.ALARM_CORNERING);
+ break;
+ default:
+ break;
+ }
+ break;
case 239:
position.set(Position.KEY_IGNITION, readValue(buf, length, false) == 1);
break;
diff --git a/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java b/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java
index c76247ac1..a40e48d82 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(
+ "000000000000008c08010000013feb55ff74000f0ea850209a690000940000120000001e09FD01FE210300040016014703f0001504c8000c0900730a00460b00501300464306d7440000b5000bb60007422e9f180000cd0386ce000107c700000000f10000601a46000001344800000bb84900000bb84a00000bb84c00000000024e0000000000000000cf00000000000000000100003fca"));
+
+ verifyPositions(decoder, false, binary(
"00000000000000A708010000016269E7D9A8000A5A0F0A1CBF8F3300880046120000001C0801014F005100550F740073007801790103430000440000426F980B540000000056000045275700000047580000022659000000005D0000000068000003D07100007355870000000288000000008A000045270669584C5241534834336A30304731363538326B3600FFFFFF0000008155412055414430308230303039383236368330303000000000000100008396"));
verifyPositions(decoder, false, binary(