From 8e555ab17b231d93ab51713d6cb25510c0f92476 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 9 Oct 2015 10:11:28 +1300 Subject: Fix minor issues in Tytan decoder --- src/org/traccar/protocol/TytanProtocolDecoder.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/org/traccar/protocol/TytanProtocolDecoder.java b/src/org/traccar/protocol/TytanProtocolDecoder.java index e6710413e..3cc0d0568 100644 --- a/src/org/traccar/protocol/TytanProtocolDecoder.java +++ b/src/org/traccar/protocol/TytanProtocolDecoder.java @@ -115,7 +115,7 @@ public class TytanProtocolDecoder extends BaseProtocolDecoder { switch (type) { case 2: - position.set(Event.KEY_ODOMETER, buf.readUnsignedMedium() * 5); + position.set(Event.KEY_ODOMETER, buf.readUnsignedMedium()); break; case 5: position.set(Event.KEY_INPUT, buf.readUnsignedByte()); @@ -179,15 +179,15 @@ public class TytanProtocolDecoder extends BaseProtocolDecoder { case 107: { int fuel = buf.readUnsignedShort(); - switch (fuel >> 16) { + switch (fuel >> 14) { case 1: - position.set(Event.KEY_FUEL, (buf.readUnsignedShort() & 0x3fff) * 0.4 + "%"); + position.set(Event.KEY_FUEL, (fuel & 0x3fff) * 0.4 + "%"); break; case 2: - position.set(Event.KEY_FUEL, (buf.readUnsignedShort() & 0x3fff) * 0.5 + "l"); + position.set(Event.KEY_FUEL, (fuel & 0x3fff) * 0.5 + " l"); break; case 3: - position.set(Event.KEY_FUEL, (buf.readUnsignedShort() & 0x3fff) * -0.5 + "l"); + position.set(Event.KEY_FUEL, (fuel & 0x3fff) * -0.5 + " l"); break; } } -- cgit v1.2.3