aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-05-29 23:32:12 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-05-29 23:32:12 -0700
commitc6c94fe8e4ba1954666aaf7ef86f3dfb8fb88181 (patch)
tree344154303240e6369f94cd0e8a3a86f49b71ff99 /src/main/java/org/traccar/protocol
parentc524d170f3324ccf10944887faa3d9f35e99e31a (diff)
downloadtraccar-server-c6c94fe8e4ba1954666aaf7ef86f3dfb8fb88181.tar.gz
traccar-server-c6c94fe8e4ba1954666aaf7ef86f3dfb8fb88181.tar.bz2
traccar-server-c6c94fe8e4ba1954666aaf7ef86f3dfb8fb88181.zip
Support ignition status
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r--src/main/java/org/traccar/protocol/PstProtocolDecoder.java7
1 files 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();