summaryrefslogtreecommitdiff
path: root/altosui/AltosConfig.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-03-27 00:13:38 -0700
committerKeith Packard <keithp@keithp.com>2011-03-27 00:13:38 -0700
commit067b21993e9a97fceadb355e571e5610535336a8 (patch)
tree2be8ffa4bf6763ebc969865f67f031b88fa0f4cc /altosui/AltosConfig.java
parent91a75279b6d306ba9d068a28c64917d5312122e8 (diff)
altosui: Allow radio channel to be configured over the radio link
TeleMini/TeleNano can't be configured via USB, so we need to allow the radio channel to be set over the radio link. This change carefully sets the new radio channel, disables the remote link and then sets the teledongle channel to the new value and brings the link back up. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosConfig.java')
-rw-r--r--altosui/AltosConfig.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/altosui/AltosConfig.java b/altosui/AltosConfig.java
index 854d5384..f45e2040 100644
--- a/altosui/AltosConfig.java
+++ b/altosui/AltosConfig.java
@@ -207,13 +207,20 @@ public class AltosConfig implements ActionListener {
void save_data() {
try {
+ int channel;
start_serial();
serial_line.printf("c m %d\n", main_deploy.get());
serial_line.printf("c d %d\n", apogee_delay.get());
- if (!remote) {
- serial_line.printf("c r %d\n", radio_channel.get());
- serial_line.printf("c f %d\n", radio_calibration.get());
+ channel = radio_channel.get();
+ serial_line.printf("c r %d\n", channel);
+ if (remote) {
+ serial_line.stop_remote();
+ serial_line.set_channel(channel);
+ AltosPreferences.set_channel(device.getSerial(), channel);
+ serial_line.start_remote();
}
+ if (!remote)
+ serial_line.printf("c f %d\n", radio_calibration.get());
serial_line.printf("c c %s\n", callsign.get());
if (flight_log_max.get() != 0)
serial_line.printf("c l %d\n", flight_log_max.get());