- if (remote) {
- link.set_radio_frequency(frequency);
- link.set_callsign(callsign);
- link.start_remote();
- } else
- link.flush_input();
- config_data = new AltosConfigData(link);
-
- if (has_sensor_tm(config_data))
- record = new AltosSensorTM(link, config_data);
- else if (has_sensor_mm(config_data))
- record = sensor_mm(config_data);
- else
- record = new AltosRecordNone();
-
- if (has_gps(config_data))
- gps = new AltosGPSQuery(link, config_data);
-
- record.version = 0;
- record.callsign = config_data.callsign;
- record.serial = config_data.serial;
- record.flight = config_data.log_available() > 0 ? 255 : 0;
- record.status = 0;
- record.state = AltosLib.ao_flight_idle;
- record.gps = gps;
- record.new_gps = true;
- state = new AltosState (record, state);
+ start_link();
+ link.config_data();
+ if (state == null)
+ state = new AltosState(new AltosCalData(link.config_data()));
+ fetch.provide_data(state);
+ if (!link.has_error && !link.reply_abort)
+ worked = true;