aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-06-08 21:17:18 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-06-08 21:17:18 -0700
commit2da833f7badc1448d4ad76e11ec7ece1a61acb07 (patch)
tree46753aef346038eab139bd181d55c3d6f0f8d627 /src/main/java/org/traccar
parent10ee12025700395b08d8d5512ba586261ee9940f (diff)
downloadtrackermap-server-2da833f7badc1448d4ad76e11ec7ece1a61acb07.tar.gz
trackermap-server-2da833f7badc1448d4ad76e11ec7ece1a61acb07.tar.bz2
trackermap-server-2da833f7badc1448d4ad76e11ec7ece1a61acb07.zip
Decode temperature sensor data
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/protocol/BceProtocolDecoder.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/BceProtocolDecoder.java b/src/main/java/org/traccar/protocol/BceProtocolDecoder.java
index 60d705db8..a26b8e8e6 100644
--- a/src/main/java/org/traccar/protocol/BceProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/BceProtocolDecoder.java
@@ -225,7 +225,13 @@ public class BceProtocolDecoder extends BaseProtocolDecoder {
buf.skipBytes(16);
}
if (BitUtil.check(mask, 8)) {
- buf.skipBytes(40); // temperature sensors
+ for (int i = 1; i <= 4; i++) {
+ int temperature = buf.readUnsignedShortLE();
+ if (temperature > 0) {
+ position.set(Position.PREFIX_TEMP + i, temperature * 0.1 - 273);
+ }
+ buf.skipBytes(8);
+ }
}
if (BitUtil.check(mask, 9)) {
position.set("driver1", buf.readCharSequence(16, StandardCharsets.US_ASCII).toString().trim());