From 79e54300d36d1e6c55452e9a68d219cb68ab9085 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 24 Nov 2015 15:49:24 +1300 Subject: Fix Tytan temperature data decoding --- src/org/traccar/protocol/TytanProtocolDecoder.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/org') diff --git a/src/org/traccar/protocol/TytanProtocolDecoder.java b/src/org/traccar/protocol/TytanProtocolDecoder.java index b0c1d243b..4cc84d2c3 100644 --- a/src/org/traccar/protocol/TytanProtocolDecoder.java +++ b/src/org/traccar/protocol/TytanProtocolDecoder.java @@ -81,16 +81,8 @@ public class TytanProtocolDecoder extends BaseProtocolDecoder { position.set("authorized", ChannelBuffers.hexDump(buf.readBytes(8))); break; case 24: - Set temps = new LinkedHashSet<>(); - int temp = buf.readUnsignedByte(); - for (int i = 3; i >= 0; i--) { - n = (temp >> (2 * i)) & 0x03; - if (!temps.contains(n)) { - temps.add(n); - } - } - for (int i : temps) { - position.set(Event.PREFIX_TEMP + i, buf.readUnsignedByte()); + for (int i = 0; i < length / 2; i++) { + position.set(Event.PREFIX_TEMP + buf.readUnsignedByte(), buf.readByte()); } break; case 28: -- cgit v1.2.3