From af8c41c0b0ce8cd2ce942f6e665dbfaba86a1703 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 30 May 2019 23:42:11 -0700 Subject: Decode additional parameters --- .../java/org/traccar/protocol/T800xProtocolDecoder.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/main/java/org/traccar') 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); -- cgit v1.2.3