From 2dbe885fda32cce8da7519aac13c20fe733650a9 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 24 Aug 2015 22:55:54 +1200 Subject: Fix Megastek device identification --- src/org/traccar/protocol/MegastekProtocolDecoder.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/org/traccar') 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 { -- cgit v1.2.3