ftd2xx/ftd2xx.py
def listDevices(flags: int = 0) -> Optional[List[bytes]]:
    """Return a list of serial numbers(default), descriptions or
    locations (Windows only) of the connected FTDI devices depending on value
    of flags"""
    n = _ft.DWORD()
    call_ft(_ft.FT_ListDevices, c.byref(n), None, _ft.DWORD(defines.LIST_NUMBER_ONLY))
    devcount = n.value
    LOGGER.debug(f"Found {devcount} devices")
    if devcount:
        # since ctypes has no pointer arithmetic.
        bd = [
            c.create_string_buffer(defines.MAX_DESCRIPTION_SIZE)
            for i in range(devcount)
        ]

        # array of pointers to those strings, initially all NULL
        ba = (c.c_char_p * (devcount + 1))(*[c.addressof(x) for x in bd], None)
        # for i in range(devcount):
        #     ba[i] = c.c_char_p(bd[i])
        call_ft(_ft.FT_ListDevices, ba, c.byref(n), _ft.DWORD(defines.LIST_ALL | flags))
        return [res for res in ba[:devcount]]
    else:
        return None
Return a list of serial numbers(default), descriptions or
    locations (Windows only) of the connected FTDI devices depending on value
    of flags
Return a list of serial numbers(default), descriptions or
locations (Windows only) of the connected FTDI devices depending on value
of flags
Return a list of serial numbers ( default ) descriptions or locations ( Windows only ) of the connected FTDI devices depending on value of flags
def listDevices(flags: int = 0) -> Optional[List[bytes]]:
    n = _ft.DWORD()
    call_ft(_ft.FT_ListDevices, c.byref(n), None, _ft.DWORD(defines.LIST_NUMBER_ONLY))
    devcount = n.value
    LOGGER.debug(f"Found {devcount} devices")
    if devcount:
        bd = [
            c.create_string_buffer(defines.MAX_DESCRIPTION_SIZE)
            for i in range(devcount)
        ]
        ba = (c.c_char_p * (devcount + 1))(*[c.addressof(x) for x in bd], None)
        call_ft(_ft.FT_ListDevices, ba, c.byref(n), _ft.DWORD(defines.LIST_ALL | flags))
        return [res for res in ba[:devcount]]
    else:
        return None
def listDevices ( flags : int = 0 ) -> Optional [ List [ bytes ] ] : n = _ft . DWORD ( ) call_ft ( _ft . FT_ListDevices , c . byref ( n ) , None , _ft . DWORD ( defines . LIST_NUMBER_ONLY ) ) devcount = n . value LOGGER . debug ( f"Found {devcount} devices" ) if devcount : bd = [ c . create_string_buffer ( defines . MAX_DESCRIPTION_SIZE ) for i in range ( devcount ) ] ba = ( c . c_char_p * ( devcount + 1 ) ) ( * [ c . addressof ( x ) for x in bd ] , None ) call_ft ( _ft . FT_ListDevices , ba , c . byref ( n ) , _ft . DWORD ( defines . LIST_ALL | flags ) ) return [ res for res in ba [ : devcount ] ] else : return None
Return a list of serial numbers(default), descriptions or
locations (Windows only) of the connected FTDI devices depending on value
of flags
Return a list of serial numbers ( default ) descriptions or locations ( Windows only ) of the connected FTDI devices depending on value of flags
"""Return a list of serial numbers(default), descriptions or
    locations (Windows only) of the connected FTDI devices depending on value
    of flags""" # since ctypes has no pointer arithmetic. # array of pointers to those strings, initially all NULL # for i in range(devcount): #     ba[i] = c.c_char_p(bd[i])
flags
int