aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-07-20 12:40:40 +0300
committerGitHub <noreply@github.com>2018-07-20 12:40:40 +0300
commitbb56fa434bc9b6215269baffaf7c64f80ced079b (patch)
tree3302d233509519c81126994b4f3ff9846094fff4 /src/org/traccar
parent4c3f628ce39105f514c87833853bb52414938acc (diff)
parentd1dfd6a9fb16e1682777ca361d91c1669489ca59 (diff)
downloadtraccar-server-bb56fa434bc9b6215269baffaf7c64f80ced079b.tar.gz
traccar-server-bb56fa434bc9b6215269baffaf7c64f80ced079b.tar.bz2
traccar-server-bb56fa434bc9b6215269baffaf7c64f80ced079b.zip
Merge pull request #3974 from TheITCloud/gpsStatus
Added gps status
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/protocol/TeltonikaProtocolDecoder.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java
index 5e9b6640e..19f4bd67b 100644
--- a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java
+++ b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java
@@ -125,6 +125,11 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder {
case 67:
position.set(Position.KEY_BATTERY, readValue(buf, length, false) * 0.001);
break;
+ case 69:
+ final long gpsStatus = readValue(buf, length, false);
+ position.set("gpsStatus", gpsStatus);
+ position.setValid(gpsStatus == 3);
+ break;
case 72:
position.set(Position.PREFIX_TEMP + 1, readValue(buf, length, true) * 0.1);
break;
@@ -301,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, buf.readUnsignedByte());
}
if (BitUtil.check(locationMask, 5)) {
@@ -423,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);