From 886a1ac0550c5aecb13222668f4ca35758ec92d1 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 25 Feb 2020 21:40:33 -0800 Subject: Decode ignition value --- src/main/java/org/traccar/protocol/EskyProtocolDecoder.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java/org') diff --git a/src/main/java/org/traccar/protocol/EskyProtocolDecoder.java b/src/main/java/org/traccar/protocol/EskyProtocolDecoder.java index d9de110f4..f0ae0bc91 100644 --- a/src/main/java/org/traccar/protocol/EskyProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/EskyProtocolDecoder.java @@ -21,6 +21,7 @@ import org.traccar.BaseProtocolDecoder; import org.traccar.DeviceSession; import org.traccar.NetworkMessage; import org.traccar.Protocol; +import org.traccar.helper.BitUtil; import org.traccar.helper.Parser; import org.traccar.helper.PatternBuilder; import org.traccar.helper.UnitsConverter; @@ -88,7 +89,10 @@ public class EskyProtocolDecoder extends BaseProtocolDecoder { position.setCourse(parser.nextDouble()); if (parser.hasNext(3)) { - position.set(Position.KEY_INPUT, parser.nextHexInt()); + int input = parser.nextHexInt(); + position.set(Position.KEY_IGNITION, !BitUtil.check(input, 0)); + position.set(Position.PREFIX_IN + 1, !BitUtil.check(input, 1)); + position.set(Position.PREFIX_IN + 2, !BitUtil.check(input, 2)); position.set(Position.KEY_EVENT, parser.nextInt()); position.set(Position.KEY_ODOMETER, parser.nextInt()); } -- cgit v1.2.3