diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-09-07 10:02:54 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-09-07 10:02:54 -0700 |
commit | 10c5a55e1f08fadb8125a782d831b835aed2fea9 (patch) | |
tree | 34095258f3f953c01234e31e0467b2d102c325f4 /src/main | |
parent | 03bd0f0d0945a80f5af19d06d37ff31a52d294ed (diff) | |
download | traccar-server-10c5a55e1f08fadb8125a782d831b835aed2fea9.tar.gz traccar-server-10c5a55e1f08fadb8125a782d831b835aed2fea9.tar.bz2 traccar-server-10c5a55e1f08fadb8125a782d831b835aed2fea9.zip |
Decode external power value
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java | 11 |
1 files changed, 7 insertions, 4 deletions
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; } } |