ao_tools/ao-send-telem: Only start real-time on valid states
[fw/altos] / ao-tools / ao-send-telem / ao-send-telem.c
index db061377807bf2c9624874ef07de249f0c5c3ad9..3db44542e3095d64fd4afd42867696eb6a6a5275 100644 (file)
@@ -224,8 +224,10 @@ main (int argc, char **argv)
                                        last_tick = telem.generic.tick;
                                        send_telem(cc, &telem);
                                } else {
+                                       enum ao_flight_state state = packet_state(&telem);
                                        add_telem(&telem);
-                                       if (packet_state(&telem) > ao_flight_pad) {
+                                       if (ao_flight_pad < state && state < ao_flight_landed) {
+                                               printf ("started\n");
                                                started = 1;
                                                last_tick = send_queued(cc, realtime);
                                        }