From: Keith Packard Date: Fri, 3 Sep 2010 19:31:05 +0000 (-0700) Subject: altosui: Must flush serial line after configuring for telemetry X-Git-Tag: debian/0.7+53+g59798c6~2 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=16d8d6a8853d09f683b13f9cda3c3174a0aab130;hp=d4f64e95e31e2335470efc15df2ab357b7d197f3 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 --- 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() {