2 * Copyright © 2011 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
19 package org.altusmetrum.altoslib_11;
22 public class AltosTelemetryConfiguration extends AltosTelemetryStandard {
34 public AltosTelemetryConfiguration(int[] bytes) {
37 device_type = uint8(5);
39 config_major = uint8(8);
40 config_minor = uint8(9);
42 apogee_delay = uint16(10);
43 main_deploy = uint16(12);
44 flight_log_max = uint16(14);
45 callsign = string(16, 8);
46 version = string(24, 8);
49 public void update_state(AltosState state) {
50 super.update_state(state);
51 state.set_device_type(device_type);
52 state.set_flight(flight);
53 state.set_config(config_major, config_minor, flight_log_max);
54 if (device_type == AltosLib.product_telegps)
55 state.set_battery_voltage(AltosConvert.tele_gps_voltage(v_batt));
57 state.set_flight_params(apogee_delay, main_deploy);
59 state.set_callsign(callsign);
60 state.set_firmware_version(version);