diff options
author | Keith Packard <keithp@keithp.com> | 2014-07-02 22:48:13 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-07-05 00:38:10 -0700 |
commit | 55e6558fa7cb23fb1363a86c83fbd6abf67ea324 (patch) | |
tree | 45f14786b0c165bdb6d7249f70bf0626aad4a500 /altoslib/AltosConfigData.java | |
parent | 292cb8380b478542555b5f370e8252eafa2f74ac (diff) |
altoslib: Support multiple telemetry rates
Altos now supports 2400 and 9600 baud in addition to the classic 38400
baud rate. Add support to altoslib for these as well
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altoslib/AltosConfigData.java')
-rw-r--r-- | altoslib/AltosConfigData.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/altoslib/AltosConfigData.java b/altoslib/AltosConfigData.java index 3bf8ea43..847436cd 100644 --- a/altoslib/AltosConfigData.java +++ b/altoslib/AltosConfigData.java @@ -46,6 +46,7 @@ public class AltosConfigData implements Iterable<String> { public String callsign; public int radio_enable; public int radio_calibration; + public int telemetry_rate; /* Old HAS_RADIO values */ public int radio_channel; public int radio_setting; @@ -235,6 +236,7 @@ public class AltosConfigData implements Iterable<String> { radio_calibration = -1; radio_channel = -1; radio_setting = -1; + telemetry_rate = -1; accel_cal_plus = -1; accel_cal_minus = -1; @@ -292,6 +294,7 @@ public class AltosConfigData implements Iterable<String> { try { callsign = get_string(line, "Callsign:"); } catch (Exception e) {} try { radio_enable = get_int(line, "Radio enable:"); } catch (Exception e) {} try { radio_calibration = get_int(line, "Radio cal:"); } catch (Exception e) {} + try { telemetry_rate = get_int(line, "Telemetry rate:"); } catch (Exception e) {} /* Old HAS_RADIO values */ try { radio_channel = get_int(line, "Radio channel:"); } catch (Exception e) {} @@ -440,6 +443,8 @@ public class AltosConfigData implements Iterable<String> { callsign = source.callsign(); if (radio_calibration >= 0) radio_calibration = source.radio_calibration(); + if (telemetry_rate >= 0) + telemetry_rate = source.telemetry_rate(); /* HAS_ACCEL */ if (pad_orientation >= 0) @@ -484,6 +489,7 @@ public class AltosConfigData implements Iterable<String> { dest.set_apogee_lockout(apogee_lockout); dest.set_radio_calibration(radio_calibration); dest.set_radio_frequency(frequency()); + dest.set_telemetry_rate(telemetry_rate); boolean max_enabled = true; if (log_space() == 0) @@ -554,6 +560,9 @@ public class AltosConfigData implements Iterable<String> { if (radio_enable >= 0) link.printf("c e %d\n", radio_enable); + if (telemetry_rate >= 0) + link.printf("c T %d\n", telemetry_rate); + /* HAS_ACCEL */ /* UI doesn't support accel cal */ if (pad_orientation >= 0) |