From 10c5a55e1f08fadb8125a782d831b835aed2fea9 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 7 Sep 2020 10:02:54 -0700 Subject: Decode external power value --- src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/main/java/org/traccar') diff --git a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java index 841e2235d..a562267aa 100644 --- a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java @@ -298,19 +298,22 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder { break; case 0xEB: while (buf.readerIndex() < endIndex) { - int tenetLength = buf.readUnsignedShort(); - int tenetType = buf.readUnsignedShort(); - switch (tenetType) { + int extendedLength = buf.readUnsignedShort(); + int extendedType = buf.readUnsignedShort(); + switch (extendedType) { case 0x0001: position.set("fuel1", buf.readUnsignedShort() * 0.1); buf.readUnsignedByte(); // unused break; + case 0x0004: + position.set(Position.KEY_POWER, buf.readUnsignedShort() * 0.01); + break; case 0x0023: position.set("fuel2", Double.parseDouble( buf.readCharSequence(6, StandardCharsets.US_ASCII).toString())); break; default: - buf.skipBytes(tenetLength - 2); + buf.skipBytes(extendedLength - 2); break; } } -- cgit v1.2.3