ftd2xx.open 始终创建设备状态 FT_INVALID_HANDLE
ftd2xx.open creates always the device status FT_INVALID_HANDLE
我尝试将 ftd2xx 库与 Ubuntu 一起使用。但是总是当我想打开设备时,收到的状态是FT_INVALID_HANDLE。
在我用 python 尝试这个之前,我用 C 写了一个运行良好的程序。作为两个程序的库,我使用 libftd2xx.so.1.3.6.
import ftd2xx as ft
g = ft.open(0)
g.status
>> 1 #FT_INVALID_HANDLE
为什么设备状态总是FT_INVALID_HANDLE?
状态在class中声明为1。 status
仅告诉您设备是否以 1 打开或未以 0 打开。
class FTD2XX(object):
"""Class for communicating with an FTDI device"""
def __init__(self, handle, update=True):
"""Create an instance of the FTD2XX class with the given device handle
and populate the device info in the instance dictionary. Set
update to False to avoid a slow call to createDeviceInfoList."""
self.handle = handle
self.status = 1
# createDeviceInfoList is slow, only run if update is True
if update: createDeviceInfoList()
self.__dict__.update(self.getDeviceInfo())
我尝试将 ftd2xx 库与 Ubuntu 一起使用。但是总是当我想打开设备时,收到的状态是FT_INVALID_HANDLE。
在我用 python 尝试这个之前,我用 C 写了一个运行良好的程序。作为两个程序的库,我使用 libftd2xx.so.1.3.6.
import ftd2xx as ft
g = ft.open(0)
g.status
>> 1 #FT_INVALID_HANDLE
为什么设备状态总是FT_INVALID_HANDLE?
状态在class中声明为1。 status
仅告诉您设备是否以 1 打开或未以 0 打开。
class FTD2XX(object):
"""Class for communicating with an FTDI device"""
def __init__(self, handle, update=True):
"""Create an instance of the FTD2XX class with the given device handle
and populate the device info in the instance dictionary. Set
update to False to avoid a slow call to createDeviceInfoList."""
self.handle = handle
self.status = 1
# createDeviceInfoList is slow, only run if update is True
if update: createDeviceInfoList()
self.__dict__.update(self.getDeviceInfo())