From 4a00ea7be7c0a7102d5a19c8fcc2cdcec58319af Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 31 Oct 2021 21:45:54 -0700 Subject: Decode Edge ignition value --- .../java/org/traccar/protocol/DmtHttpProtocolDecoder.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/main/java/org') diff --git a/src/main/java/org/traccar/protocol/DmtHttpProtocolDecoder.java b/src/main/java/org/traccar/protocol/DmtHttpProtocolDecoder.java index 8283ab643..15cf84a5f 100644 --- a/src/main/java/org/traccar/protocol/DmtHttpProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/DmtHttpProtocolDecoder.java @@ -180,9 +180,15 @@ public class DmtHttpProtocolDecoder extends BaseHttpProtocolDecoder { position.set(Position.PREFIX_ADC + adc.getInt("id"), adc.getInt("val")); } - position.set(Position.KEY_INPUT, root.getInt("inputs")); - position.set(Position.KEY_OUTPUT, root.getInt("outputs")); - position.set(Position.KEY_STATUS, root.getInt("status")); + int input = root.getInt("inputs"); + int output = root.getInt("outputs"); + int status = root.getInt("status"); + + position.set(Position.KEY_IGNITION, BitUtil.check(input, 0)); + + position.set(Position.KEY_INPUT, input); + position.set(Position.KEY_OUTPUT, output); + position.set(Position.KEY_STATUS, status); if (root.containsKey("counters")) { JsonArray counters = root.getJsonArray("counters"); -- cgit v1.2.3