aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-01-24 06:08:22 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2017-01-24 06:08:22 +1300
commit36c48d354cec2888df67b303352ee5ce9d23de3e (patch)
treebfa1f7c76dbcf5b818eb146da76e3ec35337f45b /src/org
parentae05cffa22b5c563a01da1185e945d99877cab87 (diff)
downloadtrackermap-server-36c48d354cec2888df67b303352ee5ce9d23de3e.tar.gz
trackermap-server-36c48d354cec2888df67b303352ee5ce9d23de3e.tar.bz2
trackermap-server-36c48d354cec2888df67b303352ee5ce9d23de3e.zip
Small GL200 decoder refactoring
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/Gl200ProtocolDecoder.java52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
index c93d3edc9..60addcd04 100644
--- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
@@ -324,13 +324,13 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
return null;
}
- Position position = new Position();
- position.setProtocol(getProtocolName());
-
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());
if (deviceSession == null) {
return null;
}
+
+ Position position = new Position();
+ position.setProtocol(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
position.set(Position.KEY_STATUS, parser.next());
@@ -369,13 +369,13 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
return null;
}
- Position position = new Position();
- position.setProtocol(getProtocolName());
-
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());
if (deviceSession == null) {
return null;
}
+
+ Position position = new Position();
+ position.setProtocol(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
position.set("deviceType", parser.next());
@@ -425,13 +425,13 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
return null;
}
- Position position = new Position();
- position.setProtocol(getProtocolName());
-
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());
if (deviceSession == null) {
return null;
}
+
+ Position position = new Position();
+ position.setProtocol(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
position.set(Position.KEY_RPM, parser.next());
@@ -468,13 +468,13 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
return null;
}
- LinkedList<Position> positions = new LinkedList<>();
-
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());
if (deviceSession == null) {
return null;
}
+ LinkedList<Position> positions = new LinkedList<>();
+
String vin = parser.next();
int power = parser.nextInt();
@@ -542,13 +542,13 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
return null;
}
- Position position = new Position();
- position.setProtocol(getProtocolName());
-
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());
if (deviceSession == null) {
return null;
}
+
+ Position position = new Position();
+ position.setProtocol(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
decodeLocation(position, parser);
@@ -574,13 +574,13 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
return null;
}
- Position position = new Position();
- position.setProtocol(getProtocolName());
-
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());
if (deviceSession == null) {
return null;
}
+
+ Position position = new Position();
+ position.setProtocol(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
position.set(Position.KEY_RFID, parser.next());
@@ -607,13 +607,13 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
return null;
}
- Position position = new Position();
- position.setProtocol(getProtocolName());
-
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());
if (deviceSession == null) {
return null;
}
+
+ Position position = new Position();
+ position.setProtocol(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
getLastLocation(position, null);
@@ -635,13 +635,13 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
return null;
}
- Position position = new Position();
- position.setProtocol(getProtocolName());
-
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());
if (deviceSession == null) {
return null;
}
+
+ Position position = new Position();
+ position.setProtocol(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
int reportType = parser.nextInt();
@@ -681,13 +681,13 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
return null;
}
- Position position = new Position();
- position.setProtocol(getProtocolName());
-
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());
if (deviceSession == null) {
return null;
}
+
+ Position position = new Position();
+ position.setProtocol(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble()));