aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-09 10:11:28 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-09 10:11:28 +1300
commit8e555ab17b231d93ab51713d6cb25510c0f92476 (patch)
tree50ab7ba3bf2532a29eb854047089ed4228204d7f
parentaf49cbb232a46b1af07ed43551c5c07fc26bfe2f (diff)
downloadtraccar-server-8e555ab17b231d93ab51713d6cb25510c0f92476.tar.gz
traccar-server-8e555ab17b231d93ab51713d6cb25510c0f92476.tar.bz2
traccar-server-8e555ab17b231d93ab51713d6cb25510c0f92476.zip
Fix minor issues in Tytan decoder
-rw-r--r--src/org/traccar/protocol/TytanProtocolDecoder.java10
1 files changed, 5 insertions, 5 deletions
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;
}
}