aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-10-12 23:14:46 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-10-12 23:17:01 -0700
commit68c28833f6298e2f3d7dd53197fe16880cbb99be (patch)
tree0d58a1eec45cba181b6a17764dc51840b2cc8460
parentc5a9f663f56c13274b263ef040d2b622f22bce4b (diff)
downloadtrackermap-server-68c28833f6298e2f3d7dd53197fe16880cbb99be.tar.gz
trackermap-server-68c28833f6298e2f3d7dd53197fe16880cbb99be.tar.bz2
trackermap-server-68c28833f6298e2f3d7dd53197fe16880cbb99be.zip
Fix decoding
-rw-r--r--src/main/java/org/traccar/protocol/TzoneProtocolDecoder.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/TzoneProtocolDecoder.java b/src/main/java/org/traccar/protocol/TzoneProtocolDecoder.java
index b8477dcb6..249915b39 100644
--- a/src/main/java/org/traccar/protocol/TzoneProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/TzoneProtocolDecoder.java
@@ -305,7 +305,7 @@ public class TzoneProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_RSSI, buf.readUnsignedByte());
position.set("gsmStatus", buf.readUnsignedByte());
- position.set(Position.KEY_BATTERY, buf.readUnsignedShort());
+ position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.01);
if (hardware != 0x407) {
position.set(Position.KEY_POWER, buf.readUnsignedShort());
@@ -314,12 +314,12 @@ public class TzoneProtocolDecoder extends BaseProtocolDecoder {
} else {
int temperature = buf.readUnsignedShort();
if (!BitUtil.check(temperature, 15)) {
- double value = BitUtil.to(temperature, 14) * 0.01;
+ double value = BitUtil.to(temperature, 14) * 0.1;
position.set(Position.PREFIX_TEMP + 1, BitUtil.check(temperature, 14) ? -value : value);
}
int humidity = buf.readUnsignedShort();
if (!BitUtil.check(humidity, 15)) {
- position.set("humidity", BitUtil.to(humidity, 15));
+ position.set("humidity", BitUtil.to(humidity, 15) * 0.1);
}
position.set("lightSensor", buf.readUnsignedByte() == 0);
}