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/AltosGPS.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/AltosGPS.java')
-rw-r--r-- | altoslib/AltosGPS.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/altoslib/AltosGPS.java b/altoslib/AltosGPS.java index 2708d026..f2810833 100644 --- a/altoslib/AltosGPS.java +++ b/altoslib/AltosGPS.java @@ -45,6 +45,10 @@ public class AltosGPS implements Cloneable { public int h_error; /* m */ public int v_error; /* m */ + public int state; /* for TeleGPS */ + + static final int AO_GPS_STATE_VALID = 0x80; + public AltosGPSSat[] cc_gps_sat; /* tracking data */ public void ParseGPSDate(String date) throws ParseException { @@ -298,6 +302,7 @@ public class AltosGPS implements Cloneable { g.hdop = hdop; /* unitless? */ g.h_error = h_error; /* m */ g.v_error = v_error; /* m */ + g.state = state; if (cc_gps_sat != null) { g.cc_gps_sat = new AltosGPSSat[cc_gps_sat.length]; @@ -330,6 +335,7 @@ public class AltosGPS implements Cloneable { hdop = old.hdop; /* unitless? */ h_error = old.h_error; /* m */ v_error = old.v_error; /* m */ + state = old.state; if (old.cc_gps_sat != null) { cc_gps_sat = new AltosGPSSat[old.cc_gps_sat.length]; @@ -345,6 +351,7 @@ public class AltosGPS implements Cloneable { alt = AltosLib.MISSING; ClearGPSTime(); cc_gps_sat = null; + state = 0; } } |