diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-24 15:49:24 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-24 15:49:24 +1300 |
commit | 79e54300d36d1e6c55452e9a68d219cb68ab9085 (patch) | |
tree | de9882aac05b8e7d80cb72e53615961f83509c43 /src/org/traccar | |
parent | a7592bcbf5f0f430210d27245d2ba9d450770e39 (diff) | |
download | trackermap-server-79e54300d36d1e6c55452e9a68d219cb68ab9085.tar.gz trackermap-server-79e54300d36d1e6c55452e9a68d219cb68ab9085.tar.bz2 trackermap-server-79e54300d36d1e6c55452e9a68d219cb68ab9085.zip |
Fix Tytan temperature data decoding
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/protocol/TytanProtocolDecoder.java | 12 |
1 files changed, 2 insertions, 10 deletions
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<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: |