aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-05-30 23:42:11 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-05-30 23:42:11 -0700
commitaf8c41c0b0ce8cd2ce942f6e665dbfaba86a1703 (patch)
treefc43778e0c0bd0a9dcb2a35252410610c9d70114 /src/main
parent1455296728b0199eb27b74ffed8b99c9171eb84f (diff)
downloadtrackermap-server-af8c41c0b0ce8cd2ce942f6e665dbfaba86a1703.tar.gz
trackermap-server-af8c41c0b0ce8cd2ce942f6e665dbfaba86a1703.tar.bz2
trackermap-server-af8c41c0b0ce8cd2ce942f6e665dbfaba86a1703.zip
Decode additional parameters
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/T800xProtocolDecoder.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/T800xProtocolDecoder.java b/src/main/java/org/traccar/protocol/T800xProtocolDecoder.java
index 03c64cfd5..6b7f47afd 100644
--- a/src/main/java/org/traccar/protocol/T800xProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/T800xProtocolDecoder.java
@@ -232,8 +232,21 @@ public class T800xProtocolDecoder extends BaseProtocolDecoder {
}
- if (header != 0x2727 && buf.readableBytes() >= 2) {
+ if (header == 0x2727) {
+
+ buf.skipBytes(5); // acceleration
+ position.set(Position.KEY_BATTERY_LEVEL, BcdUtil.readInteger(buf, 2));
+ position.set(Position.KEY_DEVICE_TEMP, (int) buf.readByte());
+ buf.readUnsignedByte(); // front light sensor voltage
+ position.set(Position.KEY_BATTERY, BcdUtil.readInteger(buf, 2) * 0.1);
+ buf.readUnsignedByte(); // solar panel voltage
+ position.set(Position.KEY_ODOMETER, buf.readUnsignedInt());
+ position.set(Position.KEY_STATUS, buf.readUnsignedShort());
+
+ } else if (buf.readableBytes() >= 2) {
+
position.set(Position.KEY_POWER, BcdUtil.readInteger(buf, 4) * 0.01);
+
}
sendResponse(channel, header, type, index, imei, alarm);