Example #1
0
def file_to_stdout(infile=None, count=None, secs=None, btbb=False):
    ut = Ubertooth(device=False, infile=infile)
    try:
        for i in ut.rx_file_stream(count=count, secs=secs):
            if btbb:
                pkt = BtbbPacket(data=i[4:])
                if pkt.LAP:
                    print pkt
            else:
                print i
    except KeyboardInterrupt:
        pass
Example #2
0
def file_to_stdout(infile=None, count=None, secs=None, btbb=False):
    ut = Ubertooth(device=False, infile=infile)
    try:
        for i in ut.rx_file_stream(count=count, secs=secs):
            if btbb:
                pkt = BtbbPacket(data=i[4:])
                if pkt.LAP:
                    print pkt
            else:
                print i
    except KeyboardInterrupt:
        pass
Example #3
0
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()
Example #4
0
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()
Example #5
0
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()
Example #6
0
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()