aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/OsmAndProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-04-23 15:49:56 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-04-23 15:49:56 +1200
commit2a3fad9496decd83f06ae5abf067f8d4337ec741 (patch)
tree69837f0bf89cf6ff78915d70380118575cc5c47a /src/org/traccar/protocol/OsmAndProtocolDecoder.java
parenta8d2a0170b7ac891ffe784320ac2d1389f11bf68 (diff)
downloadtrackermap-server-2a3fad9496decd83f06ae5abf067f8d4337ec741.tar.gz
trackermap-server-2a3fad9496decd83f06ae5abf067f8d4337ec741.tar.bz2
trackermap-server-2a3fad9496decd83f06ae5abf067f8d4337ec741.zip
Major code refacroting
Diffstat (limited to 'src/org/traccar/protocol/OsmAndProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/OsmAndProtocolDecoder.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/OsmAndProtocolDecoder.java b/src/org/traccar/protocol/OsmAndProtocolDecoder.java
index f773a4633..85cf1219c 100644
--- a/src/org/traccar/protocol/OsmAndProtocolDecoder.java
+++ b/src/org/traccar/protocol/OsmAndProtocolDecoder.java
@@ -41,8 +41,8 @@ import org.traccar.model.Position;
public class OsmAndProtocolDecoder extends BaseProtocolDecoder {
- public OsmAndProtocolDecoder(DataManager dataManager, String protocol, Properties properties) {
- super(dataManager, protocol, properties);
+ public OsmAndProtocolDecoder(String protocol) {
+ super(protocol);
}
@Override
@@ -65,12 +65,10 @@ public class OsmAndProtocolDecoder extends BaseProtocolDecoder {
// Identification
String id = params.get(params.containsKey("id") ? "id" : "deviceid").get(0);
- try {
- position.setDeviceId(getDataManager().getDeviceByImei(id).getId());
- } catch(Exception error) {
- Log.warning("Unknown device - " + id);
+ if (!identify(id)) {
return null;
}
+ position.setDeviceId(getDeviceId());
// Decode position
position.setValid(true);