diff options
Diffstat (limited to 'src/org/traccar/protocol/BceProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/BceProtocolDecoder.java | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/org/traccar/protocol/BceProtocolDecoder.java b/src/org/traccar/protocol/BceProtocolDecoder.java index a1c45758c..2f96ab317 100644 --- a/src/org/traccar/protocol/BceProtocolDecoder.java +++ b/src/org/traccar/protocol/BceProtocolDecoder.java @@ -33,8 +33,8 @@ import org.traccar.model.Position; public class BceProtocolDecoder extends BaseProtocolDecoder { - public BceProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { - super(dataManager, protocol, properties); + public BceProtocolDecoder(String protocol) { + super(protocol); } private static final int DATA_TYPE = 7; @@ -57,11 +57,7 @@ public class BceProtocolDecoder extends BaseProtocolDecoder { ChannelBuffer buf = (ChannelBuffer) msg; String imei = String.format("%015d", buf.readLong()); - long deviceId; - try { - deviceId = getDataManager().getDeviceByImei(imei).getId(); - } catch (Exception error) { - Log.warning("Unknown device - " + imei); + if (!identify(imei)) { return null; } @@ -77,7 +73,7 @@ public class BceProtocolDecoder extends BaseProtocolDecoder { Position position = new Position(); ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); - position.setDeviceId(deviceId); + position.setDeviceId(getDeviceId()); int structEnd = buf.readUnsignedByte() + buf.readerIndex(); |