diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2014-01-23 21:36:42 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2014-01-23 21:36:42 +1300 |
commit | 090522d898384755bdf96842726c092a046ab4dd (patch) | |
tree | 5cb4f61bb6c3f007a6b5dcf94d5fa2cda47dd803 | |
parent | b089b69bb231382c470a71bcf1179fd4786ba431 (diff) | |
download | traccar-server-090522d898384755bdf96842726c092a046ab4dd.tar.gz traccar-server-090522d898384755bdf96842726c092a046ab4dd.tar.bz2 traccar-server-090522d898384755bdf96842726c092a046ab4dd.zip |
Fix short Meiligao ids
-rw-r--r-- | src/org/traccar/protocol/MeiligaoProtocolDecoder.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java index 7ad91a807..635f7d67b 100644 --- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java +++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java @@ -77,7 +77,10 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { id += d2; } - return id + Crc.luhnChecksum(id); + if (id.length() == 14) { + id += Crc.luhnChecksum(id); // IMEI checksum + } + return id; } @Override |