diff options
Diffstat (limited to 'src/org/traccar/protocol/TytanProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/TytanProtocolDecoder.java | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/org/traccar/protocol/TytanProtocolDecoder.java b/src/org/traccar/protocol/TytanProtocolDecoder.java index b0c1d243b..40861bacb 100644 --- a/src/org/traccar/protocol/TytanProtocolDecoder.java +++ b/src/org/traccar/protocol/TytanProtocolDecoder.java @@ -18,10 +18,8 @@ package org.traccar.protocol; import java.net.SocketAddress; import java.nio.charset.Charset; import java.util.Date; -import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.List; -import java.util.Set; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; @@ -81,16 +79,8 @@ public class TytanProtocolDecoder extends BaseProtocolDecoder { position.set("authorized", ChannelBuffers.hexDump(buf.readBytes(8))); break; case 24: - Set<Integer> 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: |