From 6cd9be22f06f21d12ee2f668989d83d3c61d14c0 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 23 Nov 2010 19:08:07 -0800 Subject: altosui: New AltosSerial.set_radio function sets channel/call Use this anytime you need to set the device radio channel and call sign, either for telemetry reception or packet mode origination. This uses the saved callsign and per-device radio channel number. Do not use this when opening a telemetrum as there won't be a saved channel number. Signed-off-by: Keith Packard --- ao-tools/altosui/AltosSerial.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'ao-tools/altosui/AltosSerial.java') diff --git a/ao-tools/altosui/AltosSerial.java b/ao-tools/altosui/AltosSerial.java index 8a6ad05e..b19143e5 100644 --- a/ao-tools/altosui/AltosSerial.java +++ b/ao-tools/altosui/AltosSerial.java @@ -198,13 +198,18 @@ public class AltosSerial implements Runnable { devices_opened.add(device.getPath()); } altos = libaltos.altos_open(device); - if (altos == null) + if (altos == null) { + close(); throw new FileNotFoundException(device.toShortString()); + } input_thread = new Thread(this); input_thread.start(); print("~\nE 0\n"); + set_monitor(false); flush_output(); - set_monitor(monitor_mode); + } + + public void set_radio() { set_channel(AltosPreferences.channel(device.getSerial())); set_callsign(AltosPreferences.callsign()); } -- cgit v1.2.3