aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-05-17 21:47:03 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-05-17 21:47:03 -0700
commit9702fc67d842017f27832abd3b8edba47cda0f4f (patch)
treecc06ee1feacce20f05a97e5225a74772f858a104 /src/main
parentb9bcc74cf1945360dcd8dac12e2718c8f8971562 (diff)
downloadtraccar-server-9702fc67d842017f27832abd3b8edba47cda0f4f.tar.gz
traccar-server-9702fc67d842017f27832abd3b8edba47cda0f4f.tar.bz2
traccar-server-9702fc67d842017f27832abd3b8edba47cda0f4f.zip
Decode additional data (fix #4677)
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
index b7d6d2595..f60cead10 100644
--- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -877,6 +877,17 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
position.set("driverLicense", data.trim());
}
+ if (type == MSG_GPS_LBS_1 && buf.readableBytes() == 18) {
+ decodeStatus(position, buf);
+ position.set("oil", buf.readUnsignedShort());
+ int temperature = buf.readUnsignedByte();
+ if (BitUtil.check(temperature, 7)) {
+ temperature = -BitUtil.to(temperature, 7);
+ }
+ position.set(Position.PREFIX_TEMP + 1, temperature);
+ position.set(Position.KEY_ODOMETER, buf.readUnsignedInt() * 10);
+ }
+
if (type == MSG_GPS_LBS_1 && buf.readableBytes() == 2 + 6) {
int mask = buf.readUnsignedShort();
position.set(Position.KEY_IGNITION, BitUtil.check(mask, 8 + 7));