diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-05-19 08:58:45 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-05-19 08:58:45 -0700 |
commit | 732ddd925fe734b7fe9179b71c0cf047b56ad244 (patch) | |
tree | 51be11990478e704fe224401b3a9dab96e688839 /src/main/java/org | |
parent | b73732d6a64d59259f39de9412050e5c38e52e65 (diff) | |
download | trackermap-server-732ddd925fe734b7fe9179b71c0cf047b56ad244.tar.gz trackermap-server-732ddd925fe734b7fe9179b71c0cf047b56ad244.tar.bz2 trackermap-server-732ddd925fe734b7fe9179b71c0cf047b56ad244.zip |
Implement DMT alarms
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/traccar/protocol/DmtProtocolDecoder.java | 8 |
1 files changed, 8 insertions, 0 deletions
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); |