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_14;
23 import java.util.concurrent.*;
25 /* Don't change the field names in this structure; they're part of all .eeprom files */
26 public class AltosConfigData {
28 /* Version information */
29 public String manufacturer;
30 public String product;
33 public int log_format;
35 public String version;
36 public int altitude_32;
37 public int config_major, config_minor;
39 /* Config information */
41 public int main_deploy;
42 public int apogee_delay;
43 public int apogee_lockout;
46 public int radio_frequency;
47 public String callsign;
48 public int radio_enable;
49 public int radio_calibration;
50 public int telemetry_rate;
51 /* Old HAS_RADIO values */
52 public int radio_channel;
53 public int radio_setting;
56 public int accel_cal_plus, accel_cal_minus;
57 private int accel_cal_plus_cooked, accel_cal_minus_cooked;
58 private boolean accel_cal_adjusted;
59 public int pad_orientation;
62 public int flight_log_max;
66 public int ignite_mode;
69 public String aes_key;
72 public AltosPyro[] pyros;
75 public double pyro_firing_time;
78 public int aprs_interval;
80 public int aprs_format;
81 public int aprs_offset;
86 /* Storage info replies */
87 public int storage_size;
88 public int storage_erase_unit;
90 /* Log listing replies */
91 public int stored_flight;
94 public int tracker_motion;
95 public int tracker_interval;
98 public int accel_zero_along, accel_zero_across, accel_zero_through;
103 public AltosMs5607 ms5607() {
105 ms5607 = new AltosMs5607();
109 public static String get_string(String line, String label) throws ParseException {
110 if (line.startsWith(label)) {
111 String quoted = line.substring(label.length()).trim();
113 if (quoted.startsWith("\""))
114 quoted = quoted.substring(1);
115 if (quoted.endsWith("\""))
116 quoted = quoted.substring(0,quoted.length()-1);
119 throw new ParseException("mismatch", 0);
122 public static int get_int(String line, String label) throws NumberFormatException, ParseException {
123 if (line.startsWith(label)) {
124 String tail = line.substring(label.length()).trim();
125 String[] tokens = tail.split("\\s+");
126 if (tokens.length > 0)
127 return Integer.parseInt(tokens[0]);
129 throw new ParseException("mismatch", 0);
132 public static int[] get_values(String line, String label) throws NumberFormatException, ParseException {
133 if (line.startsWith(label)) {
134 String tail = line.substring(label.length()).trim();
135 String[] tokens = tail.split("\\s+");
136 if (tokens.length > 1) {
137 int[] values = new int[2];
138 values[0] = Integer.parseInt(tokens[0]);
139 values[1] = Integer.parseInt(tokens[1]);
143 throw new ParseException("mismatch", 0);
146 public int log_space() {
147 if (log_space != AltosLib.MISSING)
150 if (storage_size != AltosLib.MISSING) {
151 int space = storage_size;
153 if (storage_erase_unit != AltosLib.MISSING && use_flash_for_config())
154 space -= storage_erase_unit;
156 if (space != AltosLib.MISSING)
162 public int log_available() {
163 switch (log_format) {
164 case AltosLib.AO_LOG_FORMAT_TINY:
165 if (stored_flight == 0)
168 case AltosLib.AO_LOG_FORMAT_TELEMETRY:
169 case AltosLib.AO_LOG_FORMAT_TELESCIENCE:
172 if (flight_log_max <= 0)
174 int log_max = flight_log_max * 1024;
175 int log_space = log_space();
178 if (stored_flight <= 0)
181 log_used = stored_flight * log_max;
184 if (log_used >= log_space)
187 log_avail = (log_space - log_used) / log_max;
193 public int invert_accel_value(int value) {
194 if (value == AltosLib.MISSING)
195 return AltosLib.MISSING;
197 switch (log_format) {
198 case AltosLib.AO_LOG_FORMAT_FULL:
199 return 0x7fff - value;
200 case AltosLib.AO_LOG_FORMAT_TELEMEGA_OLD:
201 case AltosLib.AO_LOG_FORMAT_TELEMETRUM:
202 case AltosLib.AO_LOG_FORMAT_TELEMEGA:
203 case AltosLib.AO_LOG_FORMAT_TELEMEGA_3:
204 case AltosLib.AO_LOG_FORMAT_TELEMEGA_4:
206 case AltosLib.AO_LOG_FORMAT_EASYMEGA_2:
209 return AltosLib.MISSING;
213 public boolean has_monitor_battery() {
214 if (product.startsWith("TeleBT"))
219 int[] parse_version(String v) {
220 String[] parts = v.split("\\.");
221 int r[] = new int[parts.length];
223 for (int i = 0; i < parts.length; i++) {
225 r[i] = (int) AltosLib.fromdec(parts[i]);
226 } catch (NumberFormatException n) {
234 public boolean altitude_32() {
235 return altitude_32 == 1;
238 public int compare_version(String other) {
239 int[] me = parse_version(version);
240 int[] them = parse_version(other);
242 int l = Math.min(me.length, them.length);
244 for (int i = 0; i < l; i++) {
245 int d = me[i] - them[i];
256 public void reset() {
259 serial = AltosLib.MISSING;
260 flight = AltosLib.MISSING;
261 log_format = AltosLib.AO_LOG_FORMAT_UNKNOWN;
262 log_space = AltosLib.MISSING;
264 config_major = AltosLib.MISSING;
265 config_minor = AltosLib.MISSING;
267 main_deploy = AltosLib.MISSING;
268 apogee_delay = AltosLib.MISSING;
269 apogee_lockout = AltosLib.MISSING;
271 radio_frequency = AltosLib.MISSING;
273 radio_enable = AltosLib.MISSING;
274 radio_calibration = AltosLib.MISSING;
275 radio_channel = AltosLib.MISSING;
276 radio_setting = AltosLib.MISSING;
277 telemetry_rate = AltosLib.MISSING;
279 accel_cal_plus_cooked = AltosLib.MISSING;
280 accel_cal_minus_cooked = AltosLib.MISSING;
281 accel_cal_plus = AltosLib.MISSING;
282 accel_cal_minus = AltosLib.MISSING;
283 pad_orientation = AltosLib.MISSING;
284 accel_cal_adjusted = false;
286 flight_log_max = AltosLib.MISSING;
287 log_fixed = AltosLib.MISSING;
288 ignite_mode = AltosLib.MISSING;
292 pyro = AltosLib.MISSING;
293 npyro = AltosLib.MISSING;
295 pyro_firing_time = AltosLib.MISSING;
297 aprs_interval = AltosLib.MISSING;
298 aprs_ssid = AltosLib.MISSING;
299 aprs_format = AltosLib.MISSING;
300 aprs_offset = AltosLib.MISSING;
302 beep = AltosLib.MISSING;
304 tracker_motion = AltosLib.MISSING;
305 tracker_interval = AltosLib.MISSING;
307 storage_size = AltosLib.MISSING;
308 storage_erase_unit = AltosLib.MISSING;
309 stored_flight = AltosLib.MISSING;
311 accel_zero_along = AltosLib.MISSING;
312 accel_zero_across = AltosLib.MISSING;
313 accel_zero_through = AltosLib.MISSING;
316 /* Return + accel calibration relative to a specific pad orientation */
317 public int accel_cal_plus(int pad_orientation) {
319 switch (pad_orientation) {
320 case AltosLib.AO_PAD_ORIENTATION_ANTENNA_UP:
321 return accel_cal_plus_cooked;
322 case AltosLib.AO_PAD_ORIENTATION_ANTENNA_DOWN:
323 return invert_accel_value(accel_cal_minus_cooked);
325 return AltosLib.MISSING;
329 /* Return - accel calibration relative to a specific pad orientation */
330 public int accel_cal_minus(int pad_orientation) {
332 switch (pad_orientation) {
333 case AltosLib.AO_PAD_ORIENTATION_ANTENNA_UP:
334 return accel_cal_minus_cooked;
335 case AltosLib.AO_PAD_ORIENTATION_ANTENNA_DOWN:
336 return invert_accel_value(accel_cal_plus_cooked);
338 return AltosLib.MISSING;
342 /* Once we have all of the values from the config data, compute the
343 * accel cal values relative to Antenna Up orientation.
345 private void adjust_accel_cal() {
346 if (!accel_cal_adjusted &&
347 pad_orientation != AltosLib.MISSING &&
348 accel_cal_plus != AltosLib.MISSING &&
349 accel_cal_minus != AltosLib.MISSING &&
350 log_format != AltosLib.AO_LOG_FORMAT_UNKNOWN)
352 switch (pad_orientation) {
353 case AltosLib.AO_PAD_ORIENTATION_ANTENNA_UP:
354 accel_cal_plus_cooked = accel_cal_plus;
355 accel_cal_minus_cooked = accel_cal_minus;
356 accel_cal_adjusted = true;
358 case AltosLib.AO_PAD_ORIENTATION_ANTENNA_DOWN:
359 accel_cal_plus_cooked = invert_accel_value(accel_cal_minus);
360 accel_cal_minus_cooked = invert_accel_value(accel_cal_plus);
361 accel_cal_adjusted = true;
369 public void parse_line(String line) {
371 /* Version replies */
372 try { manufacturer = get_string(line, "manufacturer"); } catch (Exception e) {}
373 try { product = get_string(line, "product"); } catch (Exception e) {}
374 try { serial = get_int(line, "serial-number"); } catch (Exception e) {}
375 try { flight = get_int(line, "current-flight"); } catch (Exception e) {}
376 try { log_format = get_int(line, "log-format"); } catch (Exception e) {}
377 try { log_space = get_int(line, "log-space"); } catch (Exception e) {}
378 try { altitude_32 = get_int(line, "altitude-32"); } catch (Exception e) {}
379 try { version = get_string(line, "software-version"); } catch (Exception e) {}
381 /* Version also contains MS5607 info, which we ignore here */
383 try { ms5607().reserved = get_int(line, "ms5607 reserved:"); } catch (Exception e) {}
384 try { ms5607().sens = get_int(line, "ms5607 sens:"); } catch (Exception e) {}
385 try { ms5607().off = get_int(line, "ms5607 off:"); } catch (Exception e) {}
386 try { ms5607().tcs = get_int(line, "ms5607 tcs:"); } catch (Exception e) {}
387 try { ms5607().tco = get_int(line, "ms5607 tco:"); } catch (Exception e) {}
388 try { ms5607().tref = get_int(line, "ms5607 tref:"); } catch (Exception e) {}
389 try { ms5607().tempsens = get_int(line, "ms5607 tempsens:"); } catch (Exception e) {}
390 try { ms5607().crc = get_int(line, "ms5607 crc:"); } catch (Exception e) {}
392 /* Config show replies */
395 if (line.startsWith("Config version")) {
396 String[] bits = line.split("\\s+");
397 if (bits.length >= 3) {
398 String[] cfg = bits[2].split("\\.");
400 if (cfg.length >= 2) {
401 config_major = Integer.parseInt(cfg[0]);
402 config_minor = Integer.parseInt(cfg[1]);
406 } catch (Exception e) {}
409 try { main_deploy = get_int(line, "Main deploy:"); } catch (Exception e) {}
410 try { apogee_delay = get_int(line, "Apogee delay:"); } catch (Exception e) {}
411 try { apogee_lockout = get_int(line, "Apogee lockout:"); } catch (Exception e) {}
415 radio_frequency = get_int(line, "Frequency:");
416 if (radio_frequency < 0)
417 radio_frequency = 434550;
418 } catch (Exception e) {}
419 try { callsign = get_string(line, "Callsign:"); } catch (Exception e) {}
420 try { radio_enable = get_int(line, "Radio enable:"); } catch (Exception e) {}
421 try { radio_calibration = get_int(line, "Radio cal:"); } catch (Exception e) {}
422 try { telemetry_rate = get_int(line, "Telemetry rate:"); } catch (Exception e) {}
424 /* Old HAS_RADIO values */
425 try { radio_channel = get_int(line, "Radio channel:"); } catch (Exception e) {}
426 try { radio_setting = get_int(line, "Radio setting:"); } catch (Exception e) {}
430 if (line.startsWith("Accel cal")) {
431 String[] bits = line.split("\\s+");
432 if (bits.length >= 6) {
433 accel_cal_plus = Integer.parseInt(bits[3]);
434 accel_cal_minus = Integer.parseInt(bits[5]);
435 accel_cal_adjusted = false;
438 } catch (Exception e) {}
439 try { pad_orientation = get_int(line, "Pad orientation:"); } catch (Exception e) {}
442 try { flight_log_max = get_int(line, "Max flight log:"); } catch (Exception e) {}
443 try { log_fixed = get_int(line, "Log fixed:"); } catch (Exception e) {}
446 try { ignite_mode = get_int(line, "Ignite mode:"); } catch (Exception e) {}
449 try { aes_key = get_string(line, "AES key:"); } catch (Exception e) {}
453 npyro = get_int(line, "Pyro-count:");
454 pyros = new AltosPyro[npyro];
456 } catch (Exception e) {}
457 if (npyro != AltosLib.MISSING) {
459 AltosPyro p = new AltosPyro(pyro, line);
462 } catch (Exception e) {}
464 try { pyro_firing_time = get_int(line, "Pyro time:") / 100.0; } catch (Exception e) {}
467 try { aprs_interval = get_int(line, "APRS interval:"); } catch (Exception e) {}
468 try { aprs_ssid = get_int(line, "APRS SSID:"); } catch (Exception e) {}
469 try { aprs_format = get_int(line, "APRS format:"); } catch (Exception e) {}
470 try { aprs_offset = get_int(line, "APRS offset:"); } catch (Exception e) {}
473 try { beep = get_int(line, "Beeper setting:"); } catch (Exception e) {}
477 int[] values = get_values(line, "Tracker setting:");
478 tracker_motion = values[0];
479 tracker_interval = values[1];
480 } catch (Exception e) {}
482 /* Storage info replies */
483 try { storage_size = get_int(line, "Storage size:"); } catch (Exception e) {}
484 try { storage_erase_unit = get_int(line, "Storage erase unit:"); } catch (Exception e) {}
486 /* Log listing replies */
487 try { get_int(line, "flight"); stored_flight++; } catch (Exception e) {}
491 if (line.startsWith("IMU cal along")) {
492 String[] bits = line.split("\\s+");
493 if (bits.length >= 8) {
494 accel_zero_along = Integer.parseInt(bits[3]);
495 accel_zero_across = Integer.parseInt(bits[5]);
496 accel_zero_through = Integer.parseInt(bits[7]);
499 } catch (Exception e) {}
501 /* Fix accel cal as soon as all of the necessary values appear */
505 public AltosConfigData() {
509 private void read_link(AltosLink link, String finished) throws InterruptedException, TimeoutException {
511 String line = link.get_reply();
513 throw new TimeoutException();
514 if (line.contains("Syntax error"))
516 this.parse_line(line);
518 /* signals the end of the version info */
519 if (line.startsWith(finished))
524 public boolean has_frequency() {
525 return radio_frequency != AltosLib.MISSING || radio_setting != AltosLib.MISSING || radio_channel != AltosLib.MISSING;
528 public boolean has_telemetry_rate() {
529 return telemetry_rate != AltosLib.MISSING;
532 public void set_frequency(double freq) {
533 int frequency = radio_frequency;
534 int setting = radio_setting;
536 if (frequency != AltosLib.MISSING) {
537 radio_frequency = (int) Math.floor (freq * 1000 + 0.5);
538 radio_channel = AltosLib.MISSING;
539 } else if (setting != AltosLib.MISSING) {
540 radio_setting =AltosConvert.radio_frequency_to_setting(freq, radio_calibration);
541 radio_channel = AltosLib.MISSING;
543 radio_channel = AltosConvert.radio_frequency_to_channel(freq);
547 public double frequency() {
548 int channel = radio_channel;
549 int setting = radio_setting;
551 if (radio_frequency == AltosLib.MISSING && channel == AltosLib.MISSING && setting == AltosLib.MISSING)
552 return AltosLib.MISSING;
554 if (channel == AltosLib.MISSING)
556 if (setting == AltosLib.MISSING)
559 return AltosConvert.radio_to_frequency(radio_frequency,
565 boolean use_flash_for_config() {
566 if (product.startsWith("TeleMega"))
568 if (product.startsWith("TeleMetrum-v2"))
570 if (product.startsWith("TeleMetrum-v3"))
572 if (product.startsWith("EasyMega"))
578 public boolean mma655x_inverted() throws AltosUnknownProduct {
579 if (product != null) {
580 if (product.startsWith("EasyMega-v1"))
582 if (product.startsWith("TeleMetrum-v2"))
584 if (product.startsWith("TeleMega-v2"))
586 if (product.startsWith("TeleMega-v1"))
589 throw new AltosUnknownProduct(product);
592 public boolean adxl375_inverted() throws AltosUnknownProduct {
593 if (product != null) {
594 if (product.startsWith("EasyMega-v2"))
596 if (product.startsWith("TeleMetrum-v3"))
598 if (product.startsWith("TeleMega-v4"))
601 throw new AltosUnknownProduct(product);
604 public int adxl375_axis() throws AltosUnknownProduct {
605 if (product != null) {
606 if (product.startsWith("EasyMega-v2"))
607 return AltosAdxl375.X_AXIS;
608 if (product.startsWith("TeleMetrum-v3"))
609 return AltosAdxl375.X_AXIS;
610 if (product.startsWith("TeleMega-v4"))
611 return AltosAdxl375.X_AXIS;
613 throw new AltosUnknownProduct(product);
616 public void get_values(AltosConfigValues source) throws AltosConfigDataException {
619 if (main_deploy != AltosLib.MISSING)
620 main_deploy = source.main_deploy();
621 if (apogee_delay != AltosLib.MISSING)
622 apogee_delay = source.apogee_delay();
623 if (apogee_lockout != AltosLib.MISSING)
624 apogee_lockout = source.apogee_lockout();
628 set_frequency(source.radio_frequency());
629 if (radio_enable != AltosLib.MISSING)
630 radio_enable = source.radio_enable();
631 if (callsign != null)
632 callsign = source.callsign();
633 if (telemetry_rate != AltosLib.MISSING)
634 telemetry_rate = source.telemetry_rate();
637 if (pad_orientation != AltosLib.MISSING)
638 pad_orientation = source.pad_orientation();
640 if (accel_cal_plus_cooked != AltosLib.MISSING)
641 accel_cal_plus_cooked = source.accel_cal_plus();
643 if (accel_cal_minus_cooked != AltosLib.MISSING)
644 accel_cal_minus_cooked = source.accel_cal_minus();
647 if (flight_log_max != AltosLib.MISSING)
648 flight_log_max = source.flight_log_max();
651 if (ignite_mode != AltosLib.MISSING)
652 ignite_mode = source.ignite_mode();
655 if (npyro != AltosLib.MISSING)
656 pyros = source.pyros();
657 if (pyro_firing_time != AltosLib.MISSING)
658 pyro_firing_time = source.pyro_firing_time();
661 if (aprs_interval != AltosLib.MISSING)
662 aprs_interval = source.aprs_interval();
663 if (aprs_ssid != AltosLib.MISSING)
664 aprs_ssid = source.aprs_ssid();
665 if (aprs_format != AltosLib.MISSING)
666 aprs_format = source.aprs_format();
667 if (aprs_offset != AltosLib.MISSING)
668 aprs_offset = source.aprs_offset();
671 if (beep != AltosLib.MISSING)
672 beep = source.beep();
674 if (tracker_motion != AltosLib.MISSING)
675 tracker_motion = source.tracker_motion();
676 if (tracker_interval != AltosLib.MISSING)
677 tracker_interval = source.tracker_interval();
680 public void set_values(AltosConfigValues dest) {
681 dest.set_serial(serial);
682 dest.set_product(product);
683 dest.set_version(version);
684 dest.set_altitude_32(altitude_32);
685 dest.set_main_deploy(main_deploy);
686 dest.set_apogee_delay(apogee_delay);
687 dest.set_apogee_lockout(apogee_lockout);
688 dest.set_radio_calibration(radio_calibration);
689 dest.set_radio_frequency(frequency());
690 dest.set_telemetry_rate(telemetry_rate);
691 boolean max_enabled = true;
693 if (log_space() == 0)
696 if (log_fixed != AltosLib.MISSING)
699 switch (log_format) {
700 case AltosLib.AO_LOG_FORMAT_TINY:
704 if (stored_flight != AltosLib.MISSING)
709 dest.set_flight_log_max_enabled(max_enabled);
710 dest.set_radio_enable(radio_enable);
711 dest.set_flight_log_max_limit(log_space() / 1024);
712 dest.set_flight_log_max(flight_log_max);
713 dest.set_ignite_mode(ignite_mode);
714 dest.set_pad_orientation(pad_orientation);
715 dest.set_accel_cal(accel_cal_plus(AltosLib.AO_PAD_ORIENTATION_ANTENNA_UP),
716 accel_cal_minus(AltosLib.AO_PAD_ORIENTATION_ANTENNA_UP));
717 dest.set_callsign(callsign);
718 if (npyro != AltosLib.MISSING)
719 dest.set_pyros(pyros);
721 dest.set_pyros(null);
722 dest.set_pyro_firing_time(pyro_firing_time);
723 dest.set_aprs_interval(aprs_interval);
724 dest.set_aprs_ssid(aprs_ssid);
725 dest.set_aprs_format(aprs_format);
726 dest.set_aprs_offset(aprs_offset);
728 dest.set_tracker_motion(tracker_motion);
729 dest.set_tracker_interval(tracker_interval);
732 public boolean log_has_state() {
733 switch (log_format) {
734 case AltosLib.AO_LOG_FORMAT_TELEGPS:
740 public void save(AltosLink link, boolean remote) throws InterruptedException, TimeoutException {
743 if (main_deploy != AltosLib.MISSING)
744 link.printf("c m %d\n", main_deploy);
745 if (apogee_delay != AltosLib.MISSING)
746 link.printf("c d %d\n", apogee_delay);
747 if (apogee_lockout != AltosLib.MISSING)
748 link.printf("c L %d\n", apogee_lockout);
751 if (has_frequency()) {
752 boolean has_frequency = radio_frequency != AltosLib.MISSING;
753 boolean has_setting = radio_setting != AltosLib.MISSING;
754 double frequency = frequency();
755 link.set_radio_frequency(frequency,
759 /* When remote, reset the dongle frequency at the same time */
763 link.set_radio_frequency(frequency);
769 if (telemetry_rate != AltosLib.MISSING) {
770 link.printf("c T %d\n", telemetry_rate);
774 link.set_telemetry_rate(telemetry_rate);
780 if (callsign != null) {
781 link.printf("c c %s\n", callsign);
785 link.set_callsign(callsign);
791 if (radio_enable != AltosLib.MISSING)
792 link.printf("c e %d\n", radio_enable);
795 /* set orientation first so that we know how to set the accel cal */
796 if (pad_orientation != AltosLib.MISSING)
797 link.printf("c o %d\n", pad_orientation);
798 int plus = accel_cal_plus(pad_orientation);
799 int minus = accel_cal_minus(pad_orientation);
800 if (plus != AltosLib.MISSING && minus != AltosLib.MISSING)
801 link.printf("c a %d %d\n", plus, minus);
804 if (flight_log_max != 0)
805 link.printf("c l %d\n", flight_log_max);
808 if (ignite_mode != AltosLib.MISSING)
809 link.printf("c i %d\n", ignite_mode);
812 /* UI doesn't support AES key config */
815 if (npyro != AltosLib.MISSING) {
816 for (int p = 0; p < pyros.length; p++) {
817 link.printf("c P %s\n",
818 pyros[p].toString());
821 if (pyro_firing_time != AltosLib.MISSING)
822 link.printf("c I %d\n", (int) (pyro_firing_time * 100.0 + 0.5));
825 if (aprs_interval != AltosLib.MISSING)
826 link.printf("c A %d\n", aprs_interval);
827 if (aprs_ssid != AltosLib.MISSING)
828 link.printf("c S %d\n", aprs_ssid);
829 if (aprs_format != AltosLib.MISSING)
830 link.printf("c C %d\n", aprs_format);
831 if (aprs_offset != AltosLib.MISSING)
832 link.printf("c O %d\n", aprs_offset);
835 if (beep != AltosLib.MISSING)
836 link.printf("c b %d\n", beep);
839 if (tracker_motion != AltosLib.MISSING && tracker_interval != AltosLib.MISSING)
840 link.printf("c t %d %d\n", tracker_motion, tracker_interval);
843 /* UI doesn't support accel cal */
845 link.printf("c w\n");
849 public AltosConfigData(AltosLink link) throws InterruptedException, TimeoutException {
851 link.printf("c s\nf\nv\n");
852 read_link(link, "software-version");
853 switch (log_format) {
854 case AltosLib.AO_LOG_FORMAT_UNKNOWN:
855 case AltosLib.AO_LOG_FORMAT_NONE:
859 read_link(link, "done");