From cce68c7e6c116dc23a66dde7ca5476ad7ea575b2 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 5 Nov 2019 22:37:55 -0800 Subject: Decode inputs and outputs --- src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/main/java/org/traccar') diff --git a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java index 197e93602..cd0b3d363 100644 --- a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java @@ -593,6 +593,16 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder { position.setValid(buf.readUnsignedByte() > 0); } + if (BitUtil.check(mask, 17)) { + int input = buf.readUnsignedByte(); + position.set(Position.KEY_IGNITION, BitUtil.check(input, 0)); + position.set(Position.KEY_INPUT, input); + } + + if (BitUtil.check(mask, 18)) { + position.set(Position.KEY_OUTPUT, buf.readUnsignedByte()); + } + return position; } -- cgit v1.2.3