From 25be41a6605c3aadeb1a2140da9f7dccb9d573ea Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 1 Aug 2019 09:01:03 -0700 Subject: Decoder alarm codes --- src/main/java/org/traccar/protocol/MictrackProtocolDecoder.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main/java/org/traccar/protocol') diff --git a/src/main/java/org/traccar/protocol/MictrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/MictrackProtocolDecoder.java index e83318fa9..7204769b2 100644 --- a/src/main/java/org/traccar/protocol/MictrackProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/MictrackProtocolDecoder.java @@ -117,7 +117,9 @@ public class MictrackProtocolDecoder extends BaseProtocolDecoder { position.setNetwork(network); - position.set(Position.KEY_EVENT, Integer.parseInt(values[index++])); + int event = Integer.parseInt(values[index++]); + position.set(Position.KEY_ALARM, decodeAlarm(event)); + position.set(Position.KEY_EVENT, event); position.set(Position.KEY_BATTERY, Integer.parseInt(values[index++]) * 0.001); } @@ -131,7 +133,9 @@ public class MictrackProtocolDecoder extends BaseProtocolDecoder { index += 4; // fix values - position.set(Position.KEY_EVENT, Integer.parseInt(values[index++])); + int event = Integer.parseInt(values[index++]); + position.set(Position.KEY_ALARM, decodeAlarm(event)); + position.set(Position.KEY_EVENT, event); position.set(Position.KEY_BATTERY, Integer.parseInt(values[index++]) * 0.001); } -- cgit v1.2.3