aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorjon-stumpf <jon.stumpf@gmail.com>2017-02-18 09:27:16 -0500
committerjon-stumpf <jon.stumpf@gmail.com>2017-02-18 09:27:16 -0500
commited6a26f161f91e9e6ea3d306135e26657b4b8416 (patch)
tree0bc71c2d8017faec985263501caf0b34c51e2336 /src/org/traccar/protocol
parent354bd0ee9074c6b6ba6f29eead1bd07f978d880f (diff)
downloadtraccar-server-ed6a26f161f91e9e6ea3d306135e26657b4b8416.tar.gz
traccar-server-ed6a26f161f91e9e6ea3d306135e26657b4b8416.tar.bz2
traccar-server-ed6a26f161f91e9e6ea3d306135e26657b4b8416.zip
Updated two other protocols to provide "satVisible" information;
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/Avl301ProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/NavigilProtocolDecoder.java16
2 files changed, 9 insertions, 9 deletions
diff --git a/src/org/traccar/protocol/Avl301ProtocolDecoder.java b/src/org/traccar/protocol/Avl301ProtocolDecoder.java
index c19b96cb9..cc61be91b 100644
--- a/src/org/traccar/protocol/Avl301ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Avl301ProtocolDecoder.java
@@ -100,7 +100,7 @@ public class Avl301ProtocolDecoder extends BaseProtocolDecoder {
int gpsLength = buf.readUnsignedByte(); // gps len and sat
position.set(Position.KEY_SATELLITES, gpsLength & 0xf);
- buf.readUnsignedByte(); // satellites
+ position.set(Position.KEY_SATELLITES_VISIBLE, buf.readUnsignedByte()); // satellites
double latitude = buf.readUnsignedInt() / 600000.0;
double longitude = buf.readUnsignedInt() / 600000.0;
diff --git a/src/org/traccar/protocol/NavigilProtocolDecoder.java b/src/org/traccar/protocol/NavigilProtocolDecoder.java
index d18217861..263e5fc2b 100644
--- a/src/org/traccar/protocol/NavigilProtocolDecoder.java
+++ b/src/org/traccar/protocol/NavigilProtocolDecoder.java
@@ -95,8 +95,8 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
position.setLongitude(buf.readInt() * 0.0000001);
position.setAltitude(buf.readUnsignedShort());
- buf.readUnsignedShort(); // satellites in fix
- buf.readUnsignedShort(); // satellites in track
+ position.set(Position.KEY_SATELLITES, buf.readUnsignedShort()); // satellites in fix
+ position.set(Position.KEY_SATELLITES_VISIBLE, buf.readUnsignedShort()); // satellites in track
buf.readUnsignedShort(); // GPS antenna state
position.setSpeed(buf.readUnsignedShort() * 0.194384);
@@ -107,7 +107,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.001);
- buf.readUnsignedShort(); // battery charger status
+ position.set(Position.KEY_CHARGE, buf.readUnsignedShort()); // battery charger status
position.setTime(convertTimestamp(buf.readUnsignedInt()));
@@ -133,8 +133,8 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
position.setLongitude(buf.readInt() * 0.0000001);
position.setAltitude(buf.readUnsignedShort());
- buf.readUnsignedByte(); // satellites in fix
- buf.readUnsignedByte(); // satellites in track
+ position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); // satellites in fix
+ position.set(Position.KEY_SATELLITES_VISIBLE, buf.readUnsignedByte()); // satellites in track
position.setSpeed(buf.readUnsignedShort() * 0.194384);
position.setCourse(buf.readUnsignedShort());
@@ -219,8 +219,8 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
position.setLongitude(buf.readInt() * 0.0000001);
position.setAltitude(buf.readUnsignedShort());
- buf.readUnsignedByte(); // satellites in fix
- buf.readUnsignedByte(); // satellites in track
+ position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); // satellites in fix
+ position.set(Position.KEY_SATELLITES_VISIBLE, buf.readUnsignedByte()); // satellites in track
position.setSpeed(buf.readUnsignedShort() * 0.194384);
position.setCourse(buf.readUnsignedShort() * 0.1);
@@ -258,7 +258,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedByte()));
position.setCourse(buf.readUnsignedByte() * 2.0);
- buf.readUnsignedByte(); // satellites in fix
+ position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); // satellites in fix
position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.001);