diff options
Diffstat (limited to 'src/org/traccar/protocol/SanavProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/SanavProtocolDecoder.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/org/traccar/protocol/SanavProtocolDecoder.java b/src/org/traccar/protocol/SanavProtocolDecoder.java index 343dc87c8..abdb25d2c 100644 --- a/src/org/traccar/protocol/SanavProtocolDecoder.java +++ b/src/org/traccar/protocol/SanavProtocolDecoder.java @@ -32,8 +32,8 @@ import org.traccar.model.Position; public class SanavProtocolDecoder extends BaseProtocolDecoder { - public SanavProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { - super(dataManager, protocol, properties); + public SanavProtocolDecoder(String protocol) { + super(protocol); } private static final Pattern pattern = Pattern.compile( @@ -69,13 +69,10 @@ public class SanavProtocolDecoder extends BaseProtocolDecoder { Integer index = 1; // Identification - String imei = parser.group(index++); - try { - position.setDeviceId(getDataManager().getDeviceByImei(imei).getId()); - } catch(Exception error) { - Log.warning("Unknown device - " + imei); + if (!identify(parser.group(index++))) { return null; } + position.setDeviceId(getDeviceId()); // Time Calendar time = Calendar.getInstance(TimeZone.getTimeZone("UTC")); |