问题
I have a USB device that I have successfully set to use the WinUSB driver, and it shows up on the Raspberry Pi 2 startup screen as a connected device.
I have added it as a capability to the manifest:
<Capabilities>
<Capability Name="internetClient" />
<DeviceCapability Name="usb">
<Device Id="vidpid:1234 abcd">
<Function Type="classId:ff * *"/>
</Device>
</DeviceCapability>
</Capabilities>
Now I try to access it from my Universal App using the following code I found on MSDN:
string aqs = UsbDevice.GetDeviceSelector(0x1234, 0xabcd);
var myDevices = await DeviceInformation.FindAllAsync(aqs);
UsbDevice usbDevice = await UsbDevice.FromIdAsync(myDevices[0].Id);
The device is found as I can see it when I debug the myDevices variable, but the final line always throws the following exception:
Error HRESULT E_FAIL has been returned from a call to a COM component
Why? What can I do to remedy this and make it connect without errors?
来源:https://stackoverflow.com/questions/33764102/cant-access-usb-device-in-universal-app