aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-01-19 18:42:06 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2020-01-19 18:42:06 -0800
commitc9e760c301fb2867769d842d35e5c51e3bb843d6 (patch)
treead76555d82e678b213af5ed32789b6eebd7f3242 /src/main
parentce11cf209314dad9f7faa4c942e248ca5f64bc12 (diff)
downloadtrackermap-server-c9e760c301fb2867769d842d35e5c51e3bb843d6.tar.gz
trackermap-server-c9e760c301fb2867769d842d35e5c51e3bb843d6.tar.bz2
trackermap-server-c9e760c301fb2867769d842d35e5c51e3bb843d6.zip
Decode fuel data
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
index f425ec86f..bf5b6d89a 100644
--- a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
@@ -251,6 +251,26 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder {
case 0xD3:
position.set(Position.KEY_POWER, buf.readUnsignedShort() * 0.1);
break;
+ case 0xEB:
+ while (buf.readerIndex() < endIndex) {
+ int tenetLength = buf.readUnsignedShort();
+ int tenetType = buf.readUnsignedShort();
+ switch (tenetType) {
+ case 0x0001:
+ position.set("fuel1", buf.readUnsignedShort() * 0.1);
+ buf.readUnsignedByte(); // unused
+ break;
+ case 0x0023:
+ buf.skipBytes(4); // unused
+ position.set("fuel2", Double.parseDouble(
+ buf.readCharSequence(2, StandardCharsets.US_ASCII).toString()));
+ break;
+ default:
+ buf.skipBytes(tenetLength - 2);
+ break;
+ }
+ }
+ break;
default:
break;
}