Signed-off-by: Keith Packard <keithp@keithp.com>
public class AltosIdleReader extends AltosFlightReader {
AltosLink link;
boolean remote;
public class AltosIdleReader extends AltosFlightReader {
AltosLink link;
boolean remote;
+ AltosCalData cal_data = null;
AltosState state = null;
AltosIdleFetch fetch;
long next_millis;
AltosState state = null;
AltosIdleFetch fetch;
long next_millis;
return link.reply_abort;
}
return link.reply_abort;
}
+ public AltosCalData cal_data() {
+ if (cal_data == null) {
+ try {
+ cal_data = new AltosCalData(link.config_data());
+ } catch (InterruptedException ie) {
+ } catch (TimeoutException te) {
+ }
+ if (cal_data == null)
+ cal_data = new AltosCalData();
+ }
+ return cal_data;
+ }
+
public AltosState read() throws InterruptedException, ParseException, AltosCRCException, IOException {
boolean worked = false;
boolean aborted = false;
public AltosState read() throws InterruptedException, ParseException, AltosCRCException, IOException {
boolean worked = false;
boolean aborted = false;
try {
start_link();
if (state == null)
try {
start_link();
if (state == null)
- state = new AltosState(new AltosCalData(link.config_data()));
+ state = new AltosState(cal_data());
fetch.provide_data(state, state.cal_data);
if (!link.has_error && !link.reply_abort)
worked = true;
fetch.provide_data(state, state.cal_data);
if (!link.has_error && !link.reply_abort)
worked = true;
+ public AltosCalData cal_data() {
+ return replay.state.cal_data;
+ }
+
public AltosState read() {
switch (reads) {
case 0:
public AltosState read() {
switch (reads) {
case 0: