From e5ef42c2b22c6639d90631dbbb588f9fd2494385 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 3 Sep 2010 01:12:24 -0700 Subject: altosui: Report telemetry CRC errors in UI Telemetry CRC errors can signal problems with TeleMetrum or TeleDongle units, so report them in the UI. Signed-off-by: Keith Packard --- ao-tools/altosui/AltosTelemetry.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ao-tools/altosui/AltosTelemetry.java') diff --git a/ao-tools/altosui/AltosTelemetry.java b/ao-tools/altosui/AltosTelemetry.java index bc62690b..be22dac6 100644 --- a/ao-tools/altosui/AltosTelemetry.java +++ b/ao-tools/altosui/AltosTelemetry.java @@ -23,6 +23,7 @@ import java.util.HashMap; import altosui.AltosConvert; import altosui.AltosRecord; import altosui.AltosGPS; +import altosui.AltosCRCException; /* * Telemetry data contents @@ -53,10 +54,16 @@ import altosui.AltosGPS; */ public class AltosTelemetry extends AltosRecord { - public AltosTelemetry(String line) throws ParseException { + public AltosTelemetry(String line) throws ParseException, AltosCRCException { String[] words = line.split("\\s+"); int i = 0; + if (words[i].equals("CRC") && words[i+1].equals("INVALID")) { + i += 2; + AltosParse.word(words[i++], "RSSI"); + rssi = AltosParse.parse_int(words[i++]); + throw new AltosCRCException(rssi); + } if (words[i].equals("CALL")) { version = 0; } else { -- cgit v1.2.3