Example #1
0
def get_interfaces():
    if not hasattr(serial,
                   "__version__") or not serial.__version__.startswith('3.'):
        raise RuntimeError(
            "Too old version of python 'serial' Library. Version 3 required.")

    devices = UART.find_sniffer(
        write_data=False)  # Try non-intrusive search first

    if len(devices) == 0:
        devices = UART.find_sniffer(write_data=True)

    return devices
Example #2
0
def setup():
    global mySniffer

    # Find connected sniffers
    ports = UART.find_sniffer()

    if len(ports) > 0:
        # Initialize the sniffer on the first COM port found with baudrate 1000000.
        # If you are using an old firmware version <= 2.0.0, simply remove the baudrate parameter here.
        mySniffer = Sniffer.Sniffer(portnum=ports[0], baudrate=1000000)

    else:
        print("No sniffers found!")
        return

    # Start the sniffer module. This call is mandatory.
    mySniffer.start()

    # Wait to allow the sniffer to discover device mySniffer.
    time.sleep(5)
    # Retrieve list of discovered devicemySniffer.
    d = mySniffer.getDevices()
    # Find device with name "Example".
    dev = d.find('Example')

    if dev is not None:
        # Follow (sniff) device "Example". This call sends a REQ_FOLLOW command over UART.
        mySniffer.follow(dev)
    else:
        print("Could not find device")
Example #3
0
def setup():
    # Find connected sniffers
    ports = UART.find_sniffer()

    if len(ports) > 0:
        # Initialize the sniffer on the first port found with baudrate 1000000.
        # If you are using an old firmware version <= 2.0.0, simply remove the baudrate parameter here.
        sniffer = Sniffer.Sniffer(portnum=ports[0], baudrate=1000000)

    else:
        print("No sniffers found!")
        return

    sniffer.start()

    tls_dev_addr = [0xde, 0xde, 0x96, 0xdf, 0x92, 0x4a, True]

    for _ in range(10):
        time.sleep(1)
        devlist = sniffer.getDevices()
        found_dev = [
            dev for dev in devlist.devices if dev.address == tls_dev_addr
        ]
        if found_dev:
            follow(sniffer, found_dev[0])
            break
 def get_interfaces(self):
     devices = UART.find_sniffer(write_data=False)
     return devices