From: Keith Packard Date: Sun, 18 Nov 2012 18:10:29 +0000 (-0800) Subject: altoslib: Allow flight number to be zero X-Git-Tag: micropeak-build-2012-12-09~8 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=fcb801b145e1ae6f1c0b3418a99245d34dbf5aa4 altoslib: Allow flight number to be zero 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 --- diff --git a/altoslib/AltosLog.java b/altoslib/AltosLog.java index 1c7069ce..aa30190c 100644 --- a/altoslib/AltosLog.java +++ b/altoslib/AltosLog.java @@ -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();