diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2021-12-18 20:48:39 -0800 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2021-12-18 20:48:39 -0800 |
commit | ddd9a01c6e88e654f3fd377adcee36947e4e1e9d (patch) | |
tree | 2e234b35a607918a8a85fb82ad900bf16f2a00b0 | |
parent | 9403fd618339d0ba432794a162f90f22cdc2ebd4 (diff) | |
download | trackermap-server-ddd9a01c6e88e654f3fd377adcee36947e4e1e9d.tar.gz trackermap-server-ddd9a01c6e88e654f3fd377adcee36947e4e1e9d.tar.bz2 trackermap-server-ddd9a01c6e88e654f3fd377adcee36947e4e1e9d.zip |
Decode ignition
-rw-r--r-- | src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java | 10 |
1 files 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)) { |