aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-08-01 09:01:03 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-08-01 09:01:03 -0700
commit25be41a6605c3aadeb1a2140da9f7dccb9d573ea (patch)
tree87e7bf34a78abb015480de86912ec2b54524ad2b
parent678c6bb04f4f97e2d7f607ffb0d5d21953282bde (diff)
downloadtraccar-server-25be41a6605c3aadeb1a2140da9f7dccb9d573ea.tar.gz
traccar-server-25be41a6605c3aadeb1a2140da9f7dccb9d573ea.tar.bz2
traccar-server-25be41a6605c3aadeb1a2140da9f7dccb9d573ea.zip
Decoder alarm codes
-rw-r--r--src/main/java/org/traccar/protocol/MictrackProtocolDecoder.java8
1 files changed, 6 insertions, 2 deletions
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);
}