diff options
author | Keith Packard <keithp@keithp.com> | 2014-06-07 21:13:40 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-06-07 21:13:40 -0700 |
commit | d69547796caf74405f8304d23d4ae318315bbd7b (patch) | |
tree | cf07342d5b2707999710b159f28d520d5d8f05f1 /altoslib/AltosTelemetryLocation.java | |
parent | 428d09294ba0395fedd71346ad00fd90a4cdde97 (diff) |
altoslib: Parse TeleGPS state value from GPS telemetry packet
TeleGPS adds 0x80 to the state value to signify that this otherwise
unused byte contains the current state value
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altoslib/AltosTelemetryLocation.java')
-rw-r--r-- | altoslib/AltosTelemetryLocation.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/altoslib/AltosTelemetryLocation.java b/altoslib/AltosTelemetryLocation.java index 8368188f..67705cde 100644 --- a/altoslib/AltosTelemetryLocation.java +++ b/altoslib/AltosTelemetryLocation.java @@ -36,6 +36,7 @@ public class AltosTelemetryLocation extends AltosTelemetryStandard { int ground_speed; int climb_rate; int course; + int state; public AltosTelemetryLocation(int[] bytes) { super(bytes); @@ -57,6 +58,7 @@ public class AltosTelemetryLocation extends AltosTelemetryStandard { ground_speed = uint16(26); climb_rate = int16(28); course = uint8(30); + state = uint8(31); } public void update_state(AltosState state) { @@ -66,6 +68,7 @@ public class AltosTelemetryLocation extends AltosTelemetryStandard { gps.nsat = flags & 0xf; gps.locked = (flags & (1 << 4)) != 0; gps.connected = (flags & (1 << 5)) != 0; + gps.state = this.state; if (gps.locked) { gps.lat = latitude * 1.0e-7; |