From 03169baaea991d3c343a65ebac3eb3242d743fd0 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 18 Apr 2019 19:22:50 -0700 Subject: Decode more status options --- src/main/java/org/traccar/protocol/ItsProtocolDecoder.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/main/java/org/traccar') 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()) { -- cgit v1.2.3