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>
public int h_error; /* m */
public int v_error; /* m */
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 {
public AltosGPSSat[] cc_gps_sat; /* tracking data */
public void ParseGPSDate(String date) throws ParseException {
g.hdop = hdop; /* unitless? */
g.h_error = h_error; /* m */
g.v_error = v_error; /* m */
g.hdop = hdop; /* unitless? */
g.h_error = h_error; /* m */
g.v_error = v_error; /* m */
if (cc_gps_sat != null) {
g.cc_gps_sat = new AltosGPSSat[cc_gps_sat.length];
if (cc_gps_sat != null) {
g.cc_gps_sat = new AltosGPSSat[cc_gps_sat.length];
hdop = old.hdop; /* unitless? */
h_error = old.h_error; /* m */
v_error = old.v_error; /* m */
hdop = old.hdop; /* unitless? */
h_error = old.h_error; /* m */
v_error = old.v_error; /* m */
if (old.cc_gps_sat != null) {
cc_gps_sat = new AltosGPSSat[old.cc_gps_sat.length];
if (old.cc_gps_sat != null) {
cc_gps_sat = new AltosGPSSat[old.cc_gps_sat.length];
alt = AltosLib.MISSING;
ClearGPSTime();
cc_gps_sat = null;
alt = AltosLib.MISSING;
ClearGPSTime();
cc_gps_sat = null;
elevation = from_pad.elevation;
range = from_pad.range;
}
elevation = from_pad.elevation;
range = from_pad.range;
}
+
+ if ((gps.state & AltosGPS.AO_GPS_STATE_VALID) != 0)
+ set_state (gps.state & ~(AltosGPS.AO_GPS_STATE_VALID));
}
public void set_tick(int new_tick) {
}
public void set_tick(int new_tick) {
int ground_speed;
int climb_rate;
int course;
int ground_speed;
int climb_rate;
int course;
public AltosTelemetryLocation(int[] bytes) {
super(bytes);
public AltosTelemetryLocation(int[] bytes) {
super(bytes);
ground_speed = uint16(26);
climb_rate = int16(28);
course = uint8(30);
ground_speed = uint16(26);
climb_rate = int16(28);
course = uint8(30);
}
public void update_state(AltosState state) {
}
public void update_state(AltosState state) {
gps.nsat = flags & 0xf;
gps.locked = (flags & (1 << 4)) != 0;
gps.connected = (flags & (1 << 5)) != 0;
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;
if (gps.locked) {
gps.lat = latitude * 1.0e-7;