From cbc9ecd960d0dd27a2275b4550c30c5c88ccf5bb Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 7 Feb 2015 17:09:40 -0800 Subject: [PATCH] altosuilib: Reset telemetry state after processing it This avoids re-using stale state after switching telemetry reception parameters around, which otherwise generates spurious entries for the wrong frequencies in the scan results list. Signed-off-by: Keith Packard --- altosuilib/AltosScanUI.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/altosuilib/AltosScanUI.java b/altosuilib/AltosScanUI.java index 1b30f99d..a20a7e14 100644 --- a/altosuilib/AltosScanUI.java +++ b/altosuilib/AltosScanUI.java @@ -210,6 +210,8 @@ public class AltosScanUI frequencies[frequency_index], telemetry, rate); + /* Reset the state so we don't get this data for another channel */ + state.init(); Runnable r = new Runnable() { public void run() { results.add(result); @@ -254,9 +256,6 @@ public class AltosScanUI void next() throws InterruptedException, TimeoutException { reader.set_monitor(false); - /* Let any pending input from the last configuration drain out */ - Thread.sleep(100); - if (select_rate) { boolean wrapped = false; do { -- 2.30.2