From 216405bc49ef2fc0e9941989f054e41f2fef9cfe Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 18 Dec 2013 12:40:22 -0800 Subject: [PATCH 1/1] altoslib: Don't close telemetry reader at startup unless something fails Was always closing the file, which led to very little telemetry being received. Signed-off-by: Keith Packard --- altoslib/AltosTelemetryReader.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/altoslib/AltosTelemetryReader.java b/altoslib/AltosTelemetryReader.java index 405c555b..eeb35cb5 100644 --- a/altoslib/AltosTelemetryReader.java +++ b/altoslib/AltosTelemetryReader.java @@ -124,6 +124,7 @@ public class AltosTelemetryReader extends AltosFlightReader { public AltosTelemetryReader (AltosLink in_link) throws IOException, InterruptedException, TimeoutException { link = in_link; + boolean success = false; try { log = new AltosLog(link); name = link.name; @@ -133,8 +134,10 @@ public class AltosTelemetryReader extends AltosFlightReader { telemetry = AltosPreferences.telemetry(link.serial); set_telemetry(telemetry); link.add_monitor(telem); + success = true; } finally { - close(true); + if (!success) + close(true); } } } -- 2.30.2