aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/CityeasyProtocolDecoder.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/org/traccar/protocol/CityeasyProtocolDecoder.java b/src/org/traccar/protocol/CityeasyProtocolDecoder.java
index ba6a3e62d..c0288a8d5 100644
--- a/src/org/traccar/protocol/CityeasyProtocolDecoder.java
+++ b/src/org/traccar/protocol/CityeasyProtocolDecoder.java
@@ -15,6 +15,12 @@
*/
package org.traccar.protocol;
+import java.net.SocketAddress;
+import java.nio.charset.Charset;
+import java.util.Calendar;
+import java.util.TimeZone;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
@@ -23,13 +29,6 @@ import org.traccar.helper.Crc;
import org.traccar.model.Event;
import org.traccar.model.Position;
-import java.net.SocketAddress;
-import java.nio.charset.Charset;
-import java.util.Calendar;
-import java.util.TimeZone;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
public class CityeasyProtocolDecoder extends BaseProtocolDecoder {
public CityeasyProtocolDecoder(CityeasyProtocol protocol) {
@@ -66,9 +65,10 @@ public class CityeasyProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedShort(); // length
String imei = ChannelBufferTools.readHexString(buf, 14);
- imei += Crc.luhnChecksum(Long.valueOf(imei));
- if (!identify(imei, channel)) {
- return null;
+ if (!identify(imei, channel, null, false)) {
+ if (!identify(imei + Crc.luhnChecksum(Long.valueOf(imei)), channel)) {
+ return null;
+ }
}
int type = buf.readUnsignedShort();