From 16d8d6a8853d09f683b13f9cda3c3174a0aab130 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 3 Sep 2010 12:31:05 -0700 Subject: [PATCH 1/1] 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 --- ao-tools/altosui/AltosSerial.java | 11 ++++++++--- 1 file 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() { -- 2.30.2