aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/PositrexProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-12-05 21:46:34 -0800
committerAnton Tananaev <anton@traccar.org>2023-12-05 21:46:34 -0800
commitf26a894807be6c2ea06e28d3ce33d7aea34a1ade (patch)
treefabcdc8b7dec4dd5f5cc08c6ed4212aaa446a314 /src/main/java/org/traccar/protocol/PositrexProtocolDecoder.java
parent26d09785ffc30be8af27bdc6e9a30f4c5d174d37 (diff)
downloadtrackermap-server-f26a894807be6c2ea06e28d3ce33d7aea34a1ade.tar.gz
trackermap-server-f26a894807be6c2ea06e28d3ce33d7aea34a1ade.tar.bz2
trackermap-server-f26a894807be6c2ea06e28d3ce33d7aea34a1ade.zip
Additional Positrex parameters
Diffstat (limited to 'src/main/java/org/traccar/protocol/PositrexProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/PositrexProtocolDecoder.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/PositrexProtocolDecoder.java b/src/main/java/org/traccar/protocol/PositrexProtocolDecoder.java
index ff4825e8d..82ae2c134 100644
--- a/src/main/java/org/traccar/protocol/PositrexProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/PositrexProtocolDecoder.java
@@ -95,6 +95,17 @@ public class PositrexProtocolDecoder extends BaseProtocolDecoder {
position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedByte()));
position.setCourse(buf.readUnsignedByte() * 2);
+ position.set(Position.PREFIX_IO, buf.readUnsignedByte());
+ position.set(Position.KEY_ODOMETER, buf.readUnsignedInt());
+ buf.readUnsignedInt(); // report begin
+ buf.readUnsignedInt(); // report end
+ buf.readUnsignedInt(); // number of records
+
+ if (buf.isReadable()) {
+ position.set(Position.KEY_POWER, buf.readUnsignedShort() * 0.01);
+ position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.01);
+ }
+
return position;
}