diff options
author | Keith Packard <keithp@keithp.com> | 2010-09-03 12:31:05 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-09-03 12:41:06 -0700 |
commit | 16d8d6a8853d09f683b13f9cda3c3174a0aab130 (patch) | |
tree | 0d3c5e79d0cf77ca3417f798661a95507e4b2324 /ao-tools/altosui/AltosSerial.java | |
parent | d4f64e95e31e2335470efc15df2ab357b7d197f3 (diff) |
altosui: Must flush serial line after configuring for telemetry
Without flushing the configuration commands to the serial device, it
never sees them as the telemetry input thread doesn't flush.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/altosui/AltosSerial.java')
-rw-r--r-- | ao-tools/altosui/AltosSerial.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ao-tools/altosui/AltosSerial.java b/ao-tools/altosui/AltosSerial.java index c3daf3b9..bc35d6b8 100644 --- a/ao-tools/altosui/AltosSerial.java +++ b/ao-tools/altosui/AltosSerial.java @@ -101,7 +101,8 @@ public class AltosSerial implements Runnable { } public void flush_output() { - libaltos.altos_flush(altos); + if (altos != null) + libaltos.altos_flush(altos); } public void flush_input() { @@ -180,8 +181,8 @@ public class AltosSerial implements Runnable { input_thread = new Thread(this); input_thread.start(); print("~\nE 0\n"); + flush_output(); set_monitor(monitor_mode); - flush_input(); } public void set_channel(int channel) { @@ -190,6 +191,7 @@ public class AltosSerial implements Runnable { printf("m 0\nc r %d\nm 1\n", channel); else printf("c r %d\n", channel); + flush_output(); } } @@ -200,12 +202,15 @@ public class AltosSerial implements Runnable { printf("m 1\n"); else printf("m 0\n"); + flush_output(); } } public void set_callsign(String callsign) { - if (altos != null) + if (altos != null) { printf ("c c %s\n", callsign); + flush_output(); + } } public AltosSerial() { |