summaryrefslogtreecommitdiff
path: root/ao-tools/altosui/AltosSerial.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-11-23 19:08:07 -0800
committerKeith Packard <keithp@keithp.com>2010-11-23 19:10:27 -0800
commit6cd9be22f06f21d12ee2f668989d83d3c61d14c0 (patch)
treee382abd414c9c50bc6efadee2fd8308a46e01157 /ao-tools/altosui/AltosSerial.java
parented7cf7d262fcf7c0c677c2fb981582b571de9e5e (diff)
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 <keithp@keithp.com>
Diffstat (limited to 'ao-tools/altosui/AltosSerial.java')
-rw-r--r--ao-tools/altosui/AltosSerial.java9
1 files changed, 7 insertions, 2 deletions
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());
}