From ed6a26f161f91e9e6ea3d306135e26657b4b8416 Mon Sep 17 00:00:00 2001 From: jon-stumpf Date: Sat, 18 Feb 2017 09:27:16 -0500 Subject: Updated two other protocols to provide "satVisible" information; --- src/org/traccar/protocol/Avl301ProtocolDecoder.java | 2 +- src/org/traccar/protocol/NavigilProtocolDecoder.java | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/org') 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); -- cgit v1.2.3