aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/FreedomProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/FreedomProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/FreedomProtocolDecoder.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/org/traccar/protocol/FreedomProtocolDecoder.java b/src/org/traccar/protocol/FreedomProtocolDecoder.java
index 21e6f9abc..f8ab610b1 100644
--- a/src/org/traccar/protocol/FreedomProtocolDecoder.java
+++ b/src/org/traccar/protocol/FreedomProtocolDecoder.java
@@ -32,8 +32,8 @@ import org.traccar.model.Position;
public class FreedomProtocolDecoder extends BaseProtocolDecoder {
- public FreedomProtocolDecoder(DataManager dataManager, String protocol, Properties properties) {
- super(dataManager, protocol, properties);
+ public FreedomProtocolDecoder(String protocol) {
+ super(protocol);
}
private static final Pattern pattern = Pattern.compile(
@@ -63,14 +63,11 @@ public class FreedomProtocolDecoder 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());
+
// Validity
position.setValid(true);