aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Ardi01ProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/Ardi01ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Ardi01ProtocolDecoder.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/org/traccar/protocol/Ardi01ProtocolDecoder.java b/src/org/traccar/protocol/Ardi01ProtocolDecoder.java
index e25ff1c57..4e90134ae 100644
--- a/src/org/traccar/protocol/Ardi01ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Ardi01ProtocolDecoder.java
@@ -31,8 +31,8 @@ import java.util.regex.Pattern;
public class Ardi01ProtocolDecoder extends BaseProtocolDecoder {
- public Ardi01ProtocolDecoder(DataManager dataManager, String protocol, Properties properties) {
- super(dataManager, protocol, properties);
+ public Ardi01ProtocolDecoder(String protocol) {
+ super(protocol);
}
private static final Pattern pattern = Pattern.compile(
@@ -68,14 +68,11 @@ public class Ardi01ProtocolDecoder extends BaseProtocolDecoder {
Integer index = 1;
// Detect device
- 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());
+
// Date and time
Calendar time = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
time.clear();