From 732ddd925fe734b7fe9179b71c0cf047b56ad244 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 19 May 2020 08:58:45 -0700 Subject: Implement DMT alarms --- src/main/java/org/traccar/protocol/DmtProtocolDecoder.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/org/traccar/protocol/DmtProtocolDecoder.java b/src/main/java/org/traccar/protocol/DmtProtocolDecoder.java index 58a5a88e3..b36093189 100644 --- a/src/main/java/org/traccar/protocol/DmtProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/DmtProtocolDecoder.java @@ -184,6 +184,14 @@ public class DmtProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_IGNITION, BitUtil.check(input, 0)); + if (!BitUtil.check(input, 1)) { + position.set(Position.KEY_ALARM, Position.ALARM_LOW_BATTERY); + } else if (!BitUtil.check(input, 2)) { + position.set(Position.KEY_ALARM, Position.ALARM_LOW_POWER); + } if (BitUtil.check(input, 6)) { + position.set(Position.KEY_ALARM, Position.ALARM_TAMPERING); + } + position.set(Position.KEY_INPUT, input); position.set(Position.KEY_OUTPUT, output); position.set(Position.KEY_STATUS, status); -- cgit v1.2.3