aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-01 15:04:06 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-01 15:04:06 +1300
commitc2ecf80df96f9782ef716d01678ed33f886a6480 (patch)
treefd3debdb195edd49e91072e668371254ff145ff6 /src/org/traccar/protocol
parente84f02c3bffda311e86fab584d7c40702b5223be (diff)
downloadtrackermap-server-c2ecf80df96f9782ef716d01678ed33f886a6480.tar.gz
trackermap-server-c2ecf80df96f9782ef716d01678ed33f886a6480.tar.bz2
trackermap-server-c2ecf80df96f9782ef716d01678ed33f886a6480.zip
Fix Luhn checksum calculation
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/MeiligaoProtocolDecoder.java5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
index c660107ca..faf3a5baf 100644
--- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
+++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
@@ -98,14 +98,11 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder {
}
if (id.length() == 14) {
+ // Try to recreate full IMEI number
// Sometimes first digit is cut, so this won't work
if (identify(id + Crc.luhnChecksum(Long.valueOf(id)), channel, null, false)) {
return true;
}
- } else if (id.length() > 15) {
- if (identify(id.substring(0, 15), channel, null, false)) {
- return true;
- }
}
return identify(id, channel);