From ddd9a01c6e88e654f3fd377adcee36947e4e1e9d Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 18 Dec 2021 20:48:39 -0800 Subject: Decode ignition --- .../java/org/traccar/protocol/MeitrackProtocolDecoder.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java index 5eab10498..0eb6f8776 100644 --- a/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java @@ -23,6 +23,7 @@ import org.traccar.Context; import org.traccar.DeviceSession; import org.traccar.NetworkMessage; import org.traccar.Protocol; +import org.traccar.helper.BitUtil; import org.traccar.helper.Checksum; import org.traccar.helper.Parser; import org.traccar.helper.PatternBuilder; @@ -190,8 +191,13 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { position.setNetwork(new Network(CellTower.from(mcc, mnc, lac, cid, rssi))); } - position.set(Position.KEY_INPUT, parser.nextHexInt()); - position.set(Position.KEY_OUTPUT, parser.nextHexInt()); + int input = parser.nextHexInt(); + int output = parser.nextHexInt(); + + position.set(Position.KEY_IGNITION, BitUtil.check(input, 2)); + + position.set(Position.KEY_INPUT, input); + position.set(Position.KEY_OUTPUT, output); if (parser.hasNext(2)) { -- cgit v1.2.3