diff options
| author | Keith Packard <keithp@keithp.com> | 2011-01-11 21:28:07 -0800 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2011-01-11 21:28:07 -0800 |
| commit | 440d52e34364fdeeddc76a2d744cc6d1c934364f (patch) | |
| tree | fd948bd731cae315f011357bee01f5153c280783 /altosui/AltosEepromRecord.java | |
| parent | 7ad419d81c90ef6a16656970466313767fef830f (diff) | |
altosui: Add support for parsing list of flights from the 'l' command
This adds parsing support to enumerate the available flights, but does
not yet provide any UI to use it.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosEepromRecord.java')
| -rw-r--r-- | altosui/AltosEepromRecord.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/altosui/AltosEepromRecord.java b/altosui/AltosEepromRecord.java index e61a7159..584a04b7 100644 --- a/altosui/AltosEepromRecord.java +++ b/altosui/AltosEepromRecord.java @@ -65,8 +65,10 @@ public class AltosEepromRecord { throw new TimeoutException(); int[] values = ParseHex(line); - if (values == null) - throw new ParseException(String.format("invalid line %s", line), 0); + if (values == null || values.length < 9) { + System.out.printf("invalid line %s", line); + throw new ParseException(String.format("inalid line %s", line), 0); + } if (values[0] != (addr & 0xff)) throw new ParseException(String.format("data address out of sync at 0x%x", addr), 0); |
