summaryrefslogtreecommitdiff
path: root/altosui/AltosScanUI.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-07-16 21:05:06 -0700
committerKeith Packard <keithp@keithp.com>2011-07-16 21:06:15 -0700
commit00e6981c2e0a668864fcf391932855cd8942140c (patch)
tree284a98a227437f2ff2d2fdbd96ba6200b18bffe2 /altosui/AltosScanUI.java
parentcbd14ba103ee5e3c5eec18e3a4ff13c320b98634 (diff)
altosui: Flush telemetry lines before starting to watch for scan results
This prevents pending telemetry lines from being incorrectly attributed to the wrong channel/telemetry. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosScanUI.java')
-rw-r--r--altosui/AltosScanUI.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/altosui/AltosScanUI.java b/altosui/AltosScanUI.java
index bc1638ed..96cab73b 100644
--- a/altosui/AltosScanUI.java
+++ b/altosui/AltosScanUI.java
@@ -280,6 +280,11 @@ public class AltosScanUI
reader = new AltosTelemetryReader(device);
reader.serial.set_channel(channel);
reader.serial.set_telemetry(telemetry);
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException ie) {
+ }
+ reader.flush();
handler = new TelemetryHandler();
thread = new Thread(handler);
thread.start();