summaryrefslogtreecommitdiff
path: root/ao-tools/altosui/AltosTelemetry.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-09-03 01:12:24 -0700
committerKeith Packard <keithp@keithp.com>2010-09-03 07:04:28 -0700
commite5ef42c2b22c6639d90631dbbb588f9fd2494385 (patch)
tree2ebe6d2a3a08cd7c27ad697675f68a0af2bc7c5f /ao-tools/altosui/AltosTelemetry.java
parent3b3aa448f3a0f44137f7530b04b58967ba5f22f5 (diff)
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 <keithp@keithp.com>
Diffstat (limited to 'ao-tools/altosui/AltosTelemetry.java')
-rw-r--r--ao-tools/altosui/AltosTelemetry.java9
1 files changed, 8 insertions, 1 deletions
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 {