altoslib: Allow flight number to be zero
authorKeith Packard <keithp@keithp.com>
Sun, 18 Nov 2012 18:10:29 +0000 (10:10 -0800)
committerKeith Packard <keithp@keithp.com>
Sun, 18 Nov 2012 18:10:29 +0000 (10:10 -0800)
It's zero when there's no storage space on the device. Instead of
waiting for non-zero flight number, wait for the seen_flight bit to be
set in the telem tracking state

Signed-off-by: Keith Packard <keithp@keithp.com>
altoslib/AltosLog.java

index 1c7069c..aa30190 100644 (file)
@@ -85,7 +85,7 @@ public class AltosLog implements Runnable {
                                        continue;
                                try {
                                        AltosRecord     telem = AltosTelemetry.parse(line.line, previous);
-                                       if (telem.serial != 0 && telem.flight != 0 &&
+                                       if ((telem.seen & AltosRecord.seen_flight) != 0 &&
                                            (telem.serial != serial || telem.flight != flight || log_file == null))
                                        {
                                                close_log_file();