diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2021-10-31 21:45:54 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2021-10-31 21:45:54 -0700 |
commit | 4a00ea7be7c0a7102d5a19c8fcc2cdcec58319af (patch) | |
tree | a601291bb29089ea17606eff7dc5280e75899014 /src | |
parent | dd7d1c19d3f8e50f79a057af0e2aee70165ac82f (diff) | |
download | trackermap-server-4a00ea7be7c0a7102d5a19c8fcc2cdcec58319af.tar.gz trackermap-server-4a00ea7be7c0a7102d5a19c8fcc2cdcec58319af.tar.bz2 trackermap-server-4a00ea7be7c0a7102d5a19c8fcc2cdcec58319af.zip |
Decode Edge ignition value
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/traccar/protocol/DmtHttpProtocolDecoder.java | 12 |
1 files changed, 9 insertions, 3 deletions
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"); |