From 55b0a40e51e0bee5d37f0f3d34b6f1dd287973f9 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 11 Sep 2021 19:25:07 -0700 Subject: Decode Portman ignition --- src/main/java/org/traccar/protocol/PortmanProtocolDecoder.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/traccar/protocol/PortmanProtocolDecoder.java b/src/main/java/org/traccar/protocol/PortmanProtocolDecoder.java index ebb93abd6..e1847a2b2 100644 --- a/src/main/java/org/traccar/protocol/PortmanProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/PortmanProtocolDecoder.java @@ -80,7 +80,15 @@ public class PortmanProtocolDecoder extends BaseProtocolDecoder { position.set(Position.PREFIX_TEMP + 1, parser.next()); position.set(Position.KEY_STATUS, parser.nextHexLong()); position.set(Position.KEY_DRIVER_UNIQUE_ID, parser.next()); - position.set(Position.KEY_EVENT, parser.nextInt()); + + int event = parser.nextInt(); + position.set(Position.KEY_EVENT, event); + if (event == 253) { + position.set(Position.KEY_IGNITION, true); + } else if (event == 254) { + position.set(Position.KEY_IGNITION, false); + } + position.set(Position.KEY_SATELLITES, parser.nextInt()); position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); position.set(Position.KEY_RSSI, parser.nextInt()); -- cgit v1.2.3