From 067b21993e9a97fceadb355e571e5610535336a8 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 27 Mar 2011 00:13:38 -0700 Subject: 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 --- altosui/AltosConfig.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'altosui/AltosConfig.java') 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()); -- cgit v1.2.3