From 3605d39f6cc6a9ac89afa7fddef16f475cdd728d Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 29 Jan 2014 22:43:30 +1300 Subject: Improve Meiligao decoder --- src/org/traccar/protocol/MeiligaoProtocolDecoder.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/org/traccar/protocol/MeiligaoProtocolDecoder.java') diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java index 635f7d67b..f35472319 100644 --- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java +++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java @@ -63,7 +63,7 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { private String getImei(ChannelBuffer buf) { String id = ""; - for (int i = 0; i < 7; i++) { + for (int i = 4; i < 4 + 7; i++) { int b = buf.getUnsignedByte(i); // First digit @@ -89,7 +89,7 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { throws Exception { ChannelBuffer buf = (ChannelBuffer) msg; - int command = buf.getUnsignedShort(7); + int command = buf.getUnsignedShort(4 + 7); // Login confirmation if (command == 0x5000) { @@ -112,7 +112,7 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { } // Payload offset - int offset = 7 + 2; + int offset = 4 + 7 + 2; // Create new position Position position = new Position(); -- cgit v1.2.3