aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Tlt2hProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/Tlt2hProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Tlt2hProtocolDecoder.java15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/org/traccar/protocol/Tlt2hProtocolDecoder.java b/src/org/traccar/protocol/Tlt2hProtocolDecoder.java
index 0e17fc70c..01c1ac2aa 100644
--- a/src/org/traccar/protocol/Tlt2hProtocolDecoder.java
+++ b/src/org/traccar/protocol/Tlt2hProtocolDecoder.java
@@ -34,8 +34,8 @@ import org.traccar.model.Position;
public class Tlt2hProtocolDecoder extends BaseProtocolDecoder {
- public Tlt2hProtocolDecoder(DataManager dataManager, String protocol, Properties properties) {
- super(dataManager, protocol, properties);
+ public Tlt2hProtocolDecoder(String protocol) {
+ super(protocol);
}
private static final Pattern patternHeader = Pattern.compile(
@@ -75,15 +75,10 @@ public class Tlt2hProtocolDecoder extends BaseProtocolDecoder {
}
// Get device identifier
- String imei = parser.group(1);
- long deviceId;
- try {
- deviceId = getDataManager().getDeviceByImei(imei).getId();
- } catch(Exception error) {
- Log.warning("Unknown device - " + imei);
+ if (!identify(parser.group(1))) {
return null;
}
-
+
// Get status
String status = parser.group(2);
@@ -95,7 +90,7 @@ public class Tlt2hProtocolDecoder extends BaseProtocolDecoder {
if (parser.matches()) {
Position position = new Position();
ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol());
- position.setDeviceId(deviceId);
+ position.setDeviceId(getDeviceId());
Integer index = 1;