aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-05-19 22:14:49 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-05-19 22:14:49 -0700
commit1a4981e5adf0832d8590c964f00578179d85eb98 (patch)
tree4dbb0851426d0fc2205ce6ccbdfbb7437f4d8c1b /src/main/java/org/traccar/protocol
parent680caf2dae5d52f99d02958728da3f6cf9961a2d (diff)
downloadtrackermap-server-1a4981e5adf0832d8590c964f00578179d85eb98.tar.gz
trackermap-server-1a4981e5adf0832d8590c964f00578179d85eb98.tar.bz2
trackermap-server-1a4981e5adf0832d8590c964f00578179d85eb98.zip
Update PST decoder
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r--src/main/java/org/traccar/protocol/PstProtocolDecoder.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/PstProtocolDecoder.java b/src/main/java/org/traccar/protocol/PstProtocolDecoder.java
index 68d32636c..0c7826e42 100644
--- a/src/main/java/org/traccar/protocol/PstProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/PstProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019 Anton Tananaev (anton@traccar.org)
+ * Copyright 2019 - 2020 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -86,10 +86,16 @@ public class PstProtocolDecoder extends BaseProtocolDecoder {
int length = buf.readUnsignedByte();
switch (tag) {
+ case 0x09:
+ buf.readUnsignedByte(); // sensor count
+ buf.readUnsignedByte(); // sensor logic
+ int status = buf.readUnsignedByte();
+ position.set(Position.KEY_IGNITION, BitUtil.check(status, 7));
+ break;
case 0x0D:
int battery = buf.readUnsignedByte();
if (battery <= 20) {
- position.set(Position.KEY_BATTERY_LEVEL, buf.readUnsignedByte() * 5);
+ position.set(Position.KEY_BATTERY_LEVEL, battery * 5);
}
break;
case 0x10: