I'm using FTDI's managed wrapper for the ftd2xx.dll of their D2XX driver to access a USB device. The wrapper works as expected when it is used in a .NET Framework or .NET Core console application. However, when I use the wrapper in a UWP (Universal Windows Platform) app it does not:
GetNumberOfDevices
/FT_CreateDeviceInfoList
reports the correct number of connected devices.
GetDeviceList
/FT_GetDeviceInfoDetail
returns empty FT_DEVICE_INFO_NODE
elements except for the flags
field that has the value 1. According to the D2XX Programmer's Guide flags 1 indicates "port is open".
I can observe a similar effect in my non UWP apps if I open the device with one instance of the application and try to access it with another. But I have not opened the device in the UWP, since I can't get the required device information and don't know how I could close it. I'm sure there is no other app running that has the device open. If I close the UWP app and start the non UWP app it works fine.
I'm seeing the same behavior with or without the following capability in the app manifest (I'm using the correct values for VID and PID of my device):
<Capabilities>
<iot:Capability Name="lowLevelDevices" />
<DeviceCapability Name="usb">
<Device Id="vidpid:XXXX XXXX">
<Function Type="name:vendorSpecific" />
</Device>
</DeviceCapability>
</Capabilities>
Additionally, in the device manager there are sometimes "device not migrated to partial or ambiguous match" warning for the USB device. I updated the driver to the latest version 2.12.28 but still get the warning. Not sure if this is a problem since the driver is working for the non UWP apps.
Are there any restrictions on UWP apps recarding device/USB/driver usage?
Thanks in advance.