diff options
author | Edward Valley <ed.valley@yandex.com> | 2019-07-12 19:01:01 -0400 |
---|---|---|
committer | Edward Valley <ed.valley@yandex.com> | 2019-07-12 19:01:01 -0400 |
commit | 2c49e03702b7a9959eed87b8d5b2ae48c380025d (patch) | |
tree | 2288805ee4f9d0c09f10bbe7482c5e92abd63b3c /src/main/java/org/traccar | |
parent | 2ce793cfe7df9ec68708722489cec267ddda0b2b (diff) | |
download | trackermap-server-2c49e03702b7a9959eed87b8d5b2ae48c380025d.tar.gz trackermap-server-2c49e03702b7a9959eed87b8d5b2ae48c380025d.tar.bz2 trackermap-server-2c49e03702b7a9959eed87b8d5b2ae48c380025d.zip |
Allow to know if last position was found
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r-- | src/main/java/org/traccar/BaseProtocolDecoder.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/BaseProtocolDecoder.java b/src/main/java/org/traccar/BaseProtocolDecoder.java index aa5be612e..f0642f509 100644 --- a/src/main/java/org/traccar/BaseProtocolDecoder.java +++ b/src/main/java/org/traccar/BaseProtocolDecoder.java @@ -184,7 +184,9 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder { } } - public void getLastLocation(Position position, Date deviceTime) { + public boolean getLastLocation(Position position, Date deviceTime) { + boolean found = false; + if (position.getDeviceId() != 0) { position.setOutdated(true); @@ -198,6 +200,7 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder { position.setSpeed(last.getSpeed()); position.setCourse(last.getCourse()); position.setAccuracy(last.getAccuracy()); + found = true; } else { position.setFixTime(new Date(0)); } @@ -208,6 +211,8 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder { position.setDeviceTime(new Date()); } } + + return found; } @Override |