- public void update_state(AltosState state) {
- super.update_state(state);
- state.set_device_type(device_type);
- state.set_flight(flight);
- state.set_config(config_major, config_minor, apogee_delay, main_deploy, flight_log_max);
+ public void provide_data(AltosDataListener listener) {
+ super.provide_data(listener);
+
+ AltosCalData cal_data = listener.cal_data();
+
+ listener.set_device_type(device_type());
+ cal_data.set_flight(flight());
+ cal_data.set_config(config_major(), config_minor(), flight_log_max());
+ if (device_type() == AltosLib.product_telegps) {
+ int v_batt = v_batt();
+ double batt;
+ if (v_batt > 4095)
+ batt = AltosConvert.tele_gps_1_voltage(v_batt);
+ else
+ batt = AltosConvert.tele_gps_2_voltage(v_batt);
+ listener.set_battery_voltage(batt);
+ } else
+ cal_data.set_flight_params(apogee_delay() / 100.0, main_deploy());