diff options
author | Keith Packard <keithp@keithp.com> | 2011-06-28 01:03:00 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-06-28 01:03:00 -0700 |
commit | 7fd9b8f720add559b262e81d61ededc9df16ca94 (patch) | |
tree | ae32f830c27c99aacdfd6fb231e70a3ceee0f3ff /altosui/AltosLog.java | |
parent | cb239b7161feea8646425b1f5788c3c82ae24321 (diff) |
altosui: Support raw telemetry from TeleDongle
Use raw telemetry frames when TeleDongle supports them, this involves
parsing the hex dump of the packet instead of having teledongle take
the packet apart. Only the legacy format is working at this point; the
altos bits for the new split telemetry frames is not written yet.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosLog.java')
-rw-r--r-- | altosui/AltosLog.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/altosui/AltosLog.java b/altosui/AltosLog.java index dd147d21..64275f32 100644 --- a/altosui/AltosLog.java +++ b/altosui/AltosLog.java @@ -54,9 +54,10 @@ class AltosLog implements Runnable { } } - boolean open (AltosTelemetry telem) throws IOException { + boolean open (AltosRecord telem) throws IOException { AltosFile a = new AltosFile(telem); + System.out.printf("open %s\n", a.toString()); log_file = new FileWriter(a, true); if (log_file != null) { while (!pending_queue.isEmpty()) { @@ -74,18 +75,21 @@ class AltosLog implements Runnable { public void run () { try { + AltosRecord previous = null; for (;;) { AltosLine line = input_queue.take(); if (line.line == null) continue; try { - AltosTelemetry telem = new AltosTelemetry(line.line); + AltosRecord telem = AltosTelemetry.parse(line.line, previous); if (telem.serial != serial || telem.flight != flight || log_file == null) { close_log_file(); serial = telem.serial; flight = telem.flight; + System.out.printf("Opening telem %d %d\n", serial, flight); open(telem); } + previous = telem; } catch (ParseException pe) { } catch (AltosCRCException ce) { } |