summaryrefslogtreecommitdiff
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
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>
-rw-r--r--altosui/AltosConfig.java13
-rw-r--r--altosui/AltosConfigUI.java2
2 files changed, 10 insertions, 5 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());
diff --git a/altosui/AltosConfigUI.java b/altosui/AltosConfigUI.java
index e09eab25..f835ee2e 100644
--- a/altosui/AltosConfigUI.java
+++ b/altosui/AltosConfigUI.java
@@ -252,8 +252,6 @@ public class AltosConfigUI
radio_channel_value = new JComboBox(radio_channel_values);
radio_channel_value.setEditable(false);
radio_channel_value.addItemListener(this);
- if (remote)
- radio_channel_value.setEnabled(false);
pane.add(radio_channel_value, c);
/* Radio Calibration */