diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2012-12-04 22:22:07 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2012-12-04 22:22:07 +1300 |
commit | 206600cd599e03eaa095619fc8a52b742d3413a1 (patch) | |
tree | af6c677f54c987c7c7ba5e1d75c1c30796e1b860 /src/org/traccar/protocol/Gl100ProtocolDecoder.java | |
parent | a59ca5006a4d3547fbbb2931ad8a163f332ad65b (diff) | |
download | trackermap-server-206600cd599e03eaa095619fc8a52b742d3413a1.tar.gz trackermap-server-206600cd599e03eaa095619fc8a52b742d3413a1.tar.bz2 trackermap-server-206600cd599e03eaa095619fc8a52b742d3413a1.zip |
Added unknown device logging (fix #102)
Diffstat (limited to 'src/org/traccar/protocol/Gl100ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/Gl100ProtocolDecoder.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Gl100ProtocolDecoder.java b/src/org/traccar/protocol/Gl100ProtocolDecoder.java index 2e8b40a61..760e91f68 100644 --- a/src/org/traccar/protocol/Gl100ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl100ProtocolDecoder.java @@ -22,6 +22,7 @@ import java.util.regex.Pattern; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.GenericProtocolDecoder; +import org.traccar.helper.Log; import org.traccar.model.DataManager; import org.traccar.model.Position; @@ -88,7 +89,12 @@ public class Gl100ProtocolDecoder extends GenericProtocolDecoder { // Get device by IMEI String imei = parser.group(index++); - position.setDeviceId(getDataManager().getDeviceByImei(imei).getId()); + try { + position.setDeviceId(getDataManager().getDeviceByImei(imei).getId()); + } catch(Exception error) { + Log.warning("Unknown device - " + imei); + return null; + } // Validity position.setValid(Integer.valueOf(parser.group(index++)) == 0 ? false : true); |