gthvidsten
Posts: 10
Joined: Fri Jul 31, 2015 8:52 am

Can't access USB device in Universal App

Sun Nov 15, 2015 10:03 am

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:

Code: Select all

<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:

Code: Select all

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 work properly
"Anything one man can imagine other men can make real."
- Jules Verne

mozzi
Posts: 1
Joined: Sun Sep 17, 2017 3:23 pm

Re: Can't access USB device in Universal App

Sun Sep 17, 2017 3:25 pm

Did you ever end up solving this problem? Having the exact same issue.

User avatar
Clanzer
Posts: 27
Joined: Wed Jun 13, 2012 1:42 pm
Location: UK
Contact: Website

Re: Can't access USB device in Universal App

Mon Sep 18, 2017 2:30 pm

Your welcome to try the example we provided for testing the USB for one of our example projects.

https://github.com/PulseTrainHat/PulseT ... D-Template

Change the VID/PID in the Constants.cs file and the Package.appxmanifest to suit the VID/PID of your USB Device and it should pick it up.

Cheers

Sean
******************************
http://www.pthat.com
******************************

Return to “Windows 10 for IoT”