diff options
author | Maarten Meersseman <maarten.meersseman@tvh.com> | 2018-07-19 17:34:28 +0200 |
---|---|---|
committer | Maarten Meersseman <maarten.meersseman@tvh.com> | 2018-07-19 17:34:28 +0200 |
commit | 1a87b6958947484d0ab8b5acecf5ff7c3c491fd1 (patch) | |
tree | 17066464c69ad60733f6a2113206d8e8a8840e44 /src/org/traccar/protocol/TeltonikaProtocolDecoder.java | |
parent | 586eff69dde0111c6acd47ea5ecff0beac1d626c (diff) | |
download | trackermap-server-1a87b6958947484d0ab8b5acecf5ff7c3c491fd1.tar.gz trackermap-server-1a87b6958947484d0ab8b5acecf5ff7c3c491fd1.tar.bz2 trackermap-server-1a87b6958947484d0ab8b5acecf5ff7c3c491fd1.zip |
Mapped the gpsStatus to a validity state, no longer considering satellites for validity
Diffstat (limited to 'src/org/traccar/protocol/TeltonikaProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/TeltonikaProtocolDecoder.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java index 3892b107b..5f0380fcd 100644 --- a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java +++ b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java @@ -36,7 +36,6 @@ 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; @@ -129,8 +128,7 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder { case 69: 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); + position.setValid(gpsStatus == 3); break; case 72: position.set(Position.PREFIX_TEMP + 1, readValue(buf, length, true) * 0.1); @@ -308,9 +306,7 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder { } if (BitUtil.check(locationMask, 4)) { - int satellites = buf.readUnsignedByte(); - position.set(Position.KEY_SATELLITES, satellites); - position.setValid(satellites >= 3); + position.set(Position.KEY_SATELLITES, (int) buf.readUnsignedByte()); } if (BitUtil.check(locationMask, 5)) { @@ -430,6 +426,7 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder { Position position = new Position(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); + position.setValid(true); if (codec == CODEC_12) { decodeSerial(position, buf); |