diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-08-24 22:55:54 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-08-24 22:55:54 +1200 |
commit | 2dbe885fda32cce8da7519aac13c20fe733650a9 (patch) | |
tree | 52861aef8ddea028bad63cb462ec7894ad56da53 | |
parent | d2163edd62feddf812e99e1ce918e7567eba95c8 (diff) | |
download | trackermap-server-2dbe885fda32cce8da7519aac13c20fe733650a9.tar.gz trackermap-server-2dbe885fda32cce8da7519aac13c20fe733650a9.tar.bz2 trackermap-server-2dbe885fda32cce8da7519aac13c20fe733650a9.zip |
Fix Megastek device identification
-rw-r--r-- | src/org/traccar/protocol/MegastekProtocolDecoder.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/MegastekProtocolDecoder.java b/src/org/traccar/protocol/MegastekProtocolDecoder.java index f9a0cfc05..c07e73533 100644 --- a/src/org/traccar/protocol/MegastekProtocolDecoder.java +++ b/src/org/traccar/protocol/MegastekProtocolDecoder.java @@ -20,9 +20,7 @@ import java.util.Calendar; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; - import org.jboss.netty.channel.Channel; - import org.traccar.BaseProtocolDecoder; import org.traccar.model.Event; import org.traccar.model.Position; @@ -215,6 +213,14 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder { position.set(Event.KEY_MCC, parser.group(index++)); position.set(Event.KEY_MNC, parser.group(index++)); position.set(Event.KEY_LAC, parser.group(index++)); + + } else { + + if (!identify(id, channel)) { + return null; + } + position.setDeviceId(getDeviceId()); + } } else { |