aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorMaarten Meersseman <maarten.meersseman@tvh.com>2018-07-18 11:56:15 +0200
committerMaarten Meersseman <maarten.meersseman@tvh.com>2018-07-18 11:56:15 +0200
commit586eff69dde0111c6acd47ea5ecff0beac1d626c (patch)
tree296d1a7fbc9a29b6147232327dc6a33bd1fb8ec7 /src/org/traccar/protocol
parented8a0952ab8ee3bd23ea9ca616252984e9fe4c70 (diff)
downloadtraccar-server-586eff69dde0111c6acd47ea5ecff0beac1d626c.tar.gz
traccar-server-586eff69dde0111c6acd47ea5ecff0beac1d626c.tar.bz2
traccar-server-586eff69dde0111c6acd47ea5ecff0beac1d626c.zip
Mapped the gpsStatus to a validity state
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/TeltonikaProtocolDecoder.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java
index 5b5097b8f..3892b107b 100644
--- a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java
+++ b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java
@@ -36,6 +36,7 @@ import java.util.LinkedList;
import java.util.List;
public class TeltonikaProtocolDecoder extends BaseProtocolDecoder {
+ private static final long GPS_STATUS_WORKING_WITH_GPS_FIX = 3;
private boolean connectionless;
private boolean extended;
@@ -126,7 +127,10 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_BATTERY, readValue(buf, length, false) * 0.001);
break;
case 69:
- position.set("gpsStatus", readValue(buf, length, false));
+ final long gpsStatus = readValue(buf, length, false);
+ position.set("gpsStatus", gpsStatus);
+ final boolean validGpsStatus = GPS_STATUS_WORKING_WITH_GPS_FIX == gpsStatus;
+ position.setValid(position.getValid() && validGpsStatus);
break;
case 72:
position.set(Position.PREFIX_TEMP + 1, readValue(buf, length, true) * 0.1);