diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-04-18 19:22:50 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2019-04-18 19:22:50 -0700 |
commit | 03169baaea991d3c343a65ebac3eb3242d743fd0 (patch) | |
tree | e5f5f694f9ddd247cd69105e30add6dea626ed2e /src/main/java/org/traccar/protocol | |
parent | b81ad0b7a0ef5a5c9d68bbd13b9f46f746c419da (diff) | |
download | trackermap-server-03169baaea991d3c343a65ebac3eb3242d743fd0.tar.gz trackermap-server-03169baaea991d3c343a65ebac3eb3242d743fd0.tar.bz2 trackermap-server-03169baaea991d3c343a65ebac3eb3242d743fd0.zip |
Decode more status options
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r-- | src/main/java/org/traccar/protocol/ItsProtocolDecoder.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java b/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java index 306e2a1f7..313575f27 100644 --- a/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java @@ -110,6 +110,10 @@ public class ItsProtocolDecoder extends BaseProtocolDecoder { return Position.ALARM_OVERSPEED; case "TA": return Position.ALARM_TAMPERING; + case "BD": + return Position.ALARM_POWER_CUT; + case "BR": + return Position.ALARM_POWER_RESTORED; default: return null; } @@ -158,7 +162,13 @@ public class ItsProtocolDecoder extends BaseProtocolDecoder { status = parser.next(); } if (status != null) { - position.set(Position.KEY_ALARM, decodeAlarm(status)); + if (status.equals("IN")) { + position.set(Position.KEY_IGNITION, true); + } else if (status.equals("IF")) { + position.set(Position.KEY_IGNITION, false); + } else { + position.set(Position.KEY_ALARM, decodeAlarm(status)); + } } if (parser.hasNext()) { |