Send packets to UAV in idle loop

def idle_send_acks_and_nacks(self):
        '''Send packets to UAV in idle loop'''
        max_blocks_to_send = 10
        blocks_sent = 0
        i=0
        now = time.time()
        while i < len(self.blocks_to_ack_and_nack) and blocks_sent < max_blocks_to_send:
#            print("ACKLIST: %s" % ([x[1] for x in self.blocks_to_ack_and_nack],))
            stuff = self.blocks_to_ack_and_nack[i]

            [master, block, status, first_sent, last_sent] = stuff
            if status == 1:
#                print("DFLogger: ACKing block (%d)" % (block,))
                self.master.mav.remote_log_block_status_send(block,status)
                blocks_sent += 1
                del self.acking_blocks[block]
                del self.blocks_to_ack_and_nack[i]
                continue

            if block not in self.missing_blocks:
                # we've received this block now
                del self.blocks_to_ack_and_nack[i]
                continue

            # give up on packet if we have seen one with a much higher
            # number:
            if self.block_cnt - block > 200 or \
               now - first_sent > 60:
                print("DFLogger: Abandoning block (%d)" % (block,))
                del self.blocks_to_ack_and_nack[i]
                del self.missing_blocks[block]
                self.abandoned += 1
                continue

            i += 1
            # only send each nack every-so-often:
            if last_sent is not None:
                if now - last_sent < 0.1:
                    continue

            print("DFLogger: NACKing block (%d)" % (block,))
            self.master.mav.remote_log_block_status_send(block,status)
            blocks_sent += 1
            stuff[4] = now