From c771f3b021780b5a48ebd5998b27803456794c9e Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 25 Jun 2017 14:16:01 +1200 Subject: Correctly decode Meitrack temperature (fix #3287) --- src/org/traccar/protocol/MeitrackProtocolDecoder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/org/traccar/protocol/MeitrackProtocolDecoder.java index 11ecb5d72..38ecde519 100644 --- a/src/org/traccar/protocol/MeitrackProtocolDecoder.java +++ b/src/org/traccar/protocol/MeitrackProtocolDecoder.java @@ -218,7 +218,8 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { if (parser.hasNext()) { for (String temp : parser.next().split("\\|")) { int index = Integer.valueOf(temp.substring(0, 2), 16); - int value = Integer.valueOf(temp.substring(2), 16); + double value = Byte.valueOf(temp.substring(2, 4), 16); + value += (value < 0 ? -0.01 : 0.01) * Integer.valueOf(temp.substring(4), 16); position.set(Position.PREFIX_TEMP + index, value); } } -- cgit v1.2.3