From c6c94fe8e4ba1954666aaf7ef86f3dfb8fb88181 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 29 May 2020 23:32:12 -0700 Subject: Support ignition status --- src/main/java/org/traccar/protocol/PstProtocolDecoder.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/traccar/protocol/PstProtocolDecoder.java b/src/main/java/org/traccar/protocol/PstProtocolDecoder.java index 0c7826e42..f7ac93e1c 100644 --- a/src/main/java/org/traccar/protocol/PstProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/PstProtocolDecoder.java @@ -77,7 +77,9 @@ public class PstProtocolDecoder extends BaseProtocolDecoder { position.setDeviceTime(readDate(buf)); - buf.readUnsignedByte(); + int status = buf.readUnsignedByte(); + position.set(Position.KEY_IGNITION, BitUtil.check(status, 7)); + position.set(Position.KEY_STATUS, status); int count = buf.readUnsignedByte(); for (int i = 0; i < count; i++) { @@ -89,8 +91,7 @@ public class PstProtocolDecoder extends BaseProtocolDecoder { case 0x09: buf.readUnsignedByte(); // sensor count buf.readUnsignedByte(); // sensor logic - int status = buf.readUnsignedByte(); - position.set(Position.KEY_IGNITION, BitUtil.check(status, 7)); + buf.readUnsignedByte(); // sensor status break; case 0x0D: int battery = buf.readUnsignedByte(); -- cgit v1.2.3