aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-03-28 05:10:09 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2017-03-28 05:10:09 +1300
commit934026709636ac97f60b07d6de09193f3e14710f (patch)
tree12ee9799f51a744d827fcd1bac7ad3dc7a4521c1 /src
parent2e56e7d5779a47402780b284ac97e387a364b310 (diff)
downloadtraccar-server-934026709636ac97f60b07d6de09193f3e14710f.tar.gz
traccar-server-934026709636ac97f60b07d6de09193f3e14710f.tar.bz2
traccar-server-934026709636ac97f60b07d6de09193f3e14710f.zip
Remove GL200 time workaround
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/Gl200ProtocolDecoder.java32
1 files changed, 6 insertions, 26 deletions
diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
index d7ee57782..45737e277 100644
--- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
@@ -461,10 +461,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000);
if (parser.hasNext(6)) {
- Date date = parser.nextDateTime();
- if (!position.getOutdated() && position.getFixTime().after(date)) {
- position.setTime(date);
- }
+ position.setDeviceTime(parser.nextDateTime());
}
return position;
@@ -531,12 +528,8 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_RPM, parser.next());
position.set(Position.KEY_FUEL_LEVEL, parser.next());
- // workaround for wrong location time
if (parser.hasNext(6)) {
- Date date = parser.nextDateTime();
- if (!position.getOutdated() && position.getFixTime().after(date)) {
- position.setTime(date);
- }
+ position.setDeviceTime(parser.nextDateTime());
}
return positions;
@@ -563,10 +556,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000);
if (parser.hasNext(6)) {
- Date date = parser.nextDateTime();
- if (!position.getOutdated() && position.getFixTime().after(date)) {
- position.setTime(date);
- }
+ position.setDeviceTime(parser.nextDateTime());
}
return position;
@@ -594,10 +584,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000);
if (parser.hasNext(6)) {
- Date date = parser.nextDateTime();
- if (!position.getOutdated() && position.getFixTime().after(date)) {
- position.setTime(date);
- }
+ position.setDeviceTime(parser.nextDateTime());
}
return position;
@@ -700,12 +687,8 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000);
- // workaround for wrong location time
if (parser.hasNext(6)) {
- Date date = parser.nextDateTime();
- if (!position.getOutdated() && position.getFixTime().after(date)) {
- position.setTime(date);
- }
+ position.setDeviceTime(parser.nextDateTime());
}
if (Context.getConfig().getBoolean(getProtocolName() + ".ack") && channel != null) {
@@ -755,10 +738,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
}
if (parser.hasNext(6)) {
- Date date = parser.nextDateTime();
- if (!position.getOutdated() && position.getFixTime().after(date)) {
- position.setTime(date);
- }
+ position.setDeviceTime(parser.nextDateTime());
}
switch (type) {