diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-10-25 06:34:33 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-10-25 06:34:33 +1300 |
commit | c72e261e92166c0f775ad2378637ee778e65564b (patch) | |
tree | 4c46e1add1934a0b9d74ad0afb0f5adf50e317f9 /src/org/traccar/protocol | |
parent | bf42fd74dc38459ffafcf4a329634504efc90d40 (diff) | |
download | traccar-server-c72e261e92166c0f775ad2378637ee778e65564b.tar.gz traccar-server-c72e261e92166c0f775ad2378637ee778e65564b.tar.bz2 traccar-server-c72e261e92166c0f775ad2378637ee778e65564b.zip |
Fix Meitrack temperature (fix #3604)
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r-- | src/org/traccar/protocol/MeitrackProtocolDecoder.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/org/traccar/protocol/MeitrackProtocolDecoder.java index efc9c24db..a74d5ca62 100644 --- a/src/org/traccar/protocol/MeitrackProtocolDecoder.java +++ b/src/org/traccar/protocol/MeitrackProtocolDecoder.java @@ -219,13 +219,13 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { if (parser.hasNext()) { for (String temp : parser.next().split("\\|")) { - int index = Integer.valueOf(temp.substring(0, 2), 16); + int index = Integer.parseInt(temp.substring(0, 2), 16); if (protocol >= 3) { - double value = Short.valueOf(temp.substring(2), 16); + double value = (short) Integer.parseInt(temp.substring(2), 16); position.set(Position.PREFIX_TEMP + index, value * 0.01); } else { - double value = Byte.valueOf(temp.substring(2, 4), 16); - value += (value < 0 ? -0.01 : 0.01) * Integer.valueOf(temp.substring(4), 16); + double value = Byte.parseByte(temp.substring(2, 4), 16); + value += (value < 0 ? -0.01 : 0.01) * Integer.parseInt(temp.substring(4), 16); position.set(Position.PREFIX_TEMP + index, value); } } |