def ubertooth_rx_to_file(outfile=None, channel=37, count=None, secs=None, btbb=False): ut = Ubertooth() ut.set_channel(channel) f = open(outfile, "wb") try: systime = array.array("B", [0, 0, 0, 0]) for i in ut.rx_stream(count=count, secs=secs): f.write(systime + i) except KeyboardInterrupt: pass f.close() ut.close()
def ubertooth_rx_to_stdout(channel=37, count=None, secs=None): ut = Ubertooth() ut.set_channel(channel) try: for data in ut.rx_stream(count=count, secs=secs): ut.set_channel(channel % 79) channel += 1 pkt = BtbbPacket(data=data) if pkt.LAP: print pkt except KeyboardInterrupt: pass ut.close()
def ubertooth_rx_to_file(outfile=None, channel=37, count=None, secs=None, btbb=False): ut = Ubertooth() ut.set_channel(channel) f = open(outfile, 'wb') try: systime = array.array('B', [0, 0, 0, 0]) for i in ut.rx_stream(count=count, secs=secs): f.write(systime + i) except KeyboardInterrupt: pass f.close() ut.close()