Older TM firmware did not have the 'done' line at the end of the GPS
report, rather it would just stop after showing the Flags value. Check
the TM version and stop looking for GPS data when the Flags line appears.
Signed-off-by: Keith Packard <keithp@keithp.com>
}
class AltosGPSQuery extends AltosGPS {
}
class AltosGPSQuery extends AltosGPS {
- public AltosGPSQuery (AltosSerial serial) throws TimeoutException, InterruptedException {
+ public AltosGPSQuery (AltosSerial serial, AltosConfigData config_data)
+ throws TimeoutException, InterruptedException {
+ boolean says_done = config_data.compare_version("1.0") >= 0;
serial.printf("g\n");
for (;;) {
String line = serial.get_reply_no_dialog(5000);
serial.printf("g\n");
for (;;) {
String line = serial.get_reply_no_dialog(5000);
int status = Integer.decode(bits[1]);
connected = (status & Altos.AO_GPS_RUNNING) != 0;
locked = (status & Altos.AO_GPS_VALID) != 0;
int status = Integer.decode(bits[1]);
connected = (status & Altos.AO_GPS_RUNNING) != 0;
locked = (status & Altos.AO_GPS_VALID) != 0;
+ if (!says_done)
+ break;
continue;
}
if (line.startsWith("Sats:")) {
continue;
}
if (line.startsWith("Sats:")) {
serial.flush_input();
config_data = new AltosConfigData(serial);
adc = new AltosADC(serial);
serial.flush_input();
config_data = new AltosConfigData(serial);
adc = new AltosADC(serial);
- gps = new AltosGPSQuery(serial);
+ gps = new AltosGPSQuery(serial, config_data);
} finally {
if (remote)
serial.stop_remote();
} finally {
if (remote)
serial.stop_remote();
update_state();
post_state();
} catch (TimeoutException te) {
update_state();
post_state();
} catch (TimeoutException te) {
+ if (AltosSerial.debug)
+ System.out.printf ("monitor idle data timeout\n");
boolean monitor_mode;
int telemetry;
double frequency;
boolean monitor_mode;
int telemetry;
double frequency;
+ public static boolean debug;
boolean remote;
LinkedList<String> pending_output = new LinkedList<String>();
Frame frame;
boolean remote;
LinkedList<String> pending_output = new LinkedList<String>();
Frame frame;