You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DeviceManager.Current.GetDevicesAsync() does not enumerate non HID USB devices #161
When you try to enumerate USB device after registering WindowsUsbDeviceFactory, you get an empty list.
The GetClassGuid implementation in WindowsUsbDeviceFactory class must return WindowsDeviceConstants.GUID_DEVINTERFACE_USB_DEVICE instead of WindowsDeviceConstants.WinUSBGuid
With this correction, you are able to enumerate non HID USB device.
Currently, the code does enumerate non-HID devices. I know this because if you register WindowsUsbDeviceFactory without WindowsHidDeviceFactory, it picks up USB devices that WindowsHidDeviceFactory doesn't pick up. These devices don't work with Hid. This line is where Hid.Net picks the Guid up from. This guid is different from WinUSBGuid.
Do you think it should enumerate on both constants? Or, does GUID_DEVINTERFACE_USB_DEVICE contain WinUSBGuid as a subset of devices? I don't want to stop enumerating devices that it already handles. Also, can you please give me some examples of some devices that might show up as a GUID_DEVINTERFACE_USB_DEVICE so I can build some tests around this?
Perhaps if you could elaborate about your scenario, I can try to make sure that the issue is fixed permanently. What device are you trying to connect to?
I am currently adding some USB feature on hid & non hid usb device (control transfer for example), and i understood that WindowsUsbDeviceFactory should enumerate UsbDevice :)
@flyingoverclouds firstly, it sounds like you should talk to the nanoFramework people. There is already a pull request for control transfer here. I strongly recommend joining the discord channel so you can chat with us about that. The reason this PR is stalled is that I haven't been able to figure out how to test it with a real device yet.
i understood that WindowsUsbDeviceFactory should enumerate UsbDevice
Yes. of course. My question:
Do you think it should enumerate on both constants? Or, does GUID_DEVINTERFACE_USB_DEVICE contain WinUSBGuid as a subset of devices?
@flyingoverclouds I got a DFU mode device to connect. Please have a look at the latest code in the develop branch. You can see how to use WindowsDeviceConstants.GUID_DEVINTERFACE_USB_DEVICE to get a list of connected devices.
Activity
MelbourneDeveloper commentedon Oct 15, 2020
@flyingoverclouds thanks for pointing this out.
Currently, the code does enumerate non-HID devices. I know this because if you register WindowsUsbDeviceFactory without WindowsHidDeviceFactory, it picks up USB devices that WindowsHidDeviceFactory doesn't pick up. These devices don't work with Hid. This line is where Hid.Net picks the Guid up from. This guid is different from WinUSBGuid.
Do you think it should enumerate on both constants? Or, does GUID_DEVINTERFACE_USB_DEVICE contain WinUSBGuid as a subset of devices? I don't want to stop enumerating devices that it already handles. Also, can you please give me some examples of some devices that might show up as a GUID_DEVINTERFACE_USB_DEVICE so I can build some tests around this?
Perhaps if you could elaborate about your scenario, I can try to make sure that the issue is fixed permanently. What device are you trying to connect to?
flyingoverclouds commentedon Oct 16, 2020
I am currently adding some USB feature on hid & non hid usb device (control transfer for example), and i understood that WindowsUsbDeviceFactory should enumerate UsbDevice :)
MelbourneDeveloper commentedon Oct 16, 2020
@flyingoverclouds firstly, it sounds like you should talk to the nanoFramework people. There is already a pull request for control transfer here. I strongly recommend joining the discord channel so you can chat with us about that. The reason this PR is stalled is that I haven't been able to figure out how to test it with a real device yet.
Yes. of course. My question:
MelbourneDeveloper commentedon Nov 6, 2020
@flyingoverclouds have you made any progress with control transfer?
What is the device that you are using? I need to get a device that I can test control transfer with. Did you join discord by any chance?
MelbourneDeveloper commentedon Nov 6, 2020
@flyingoverclouds I got a DFU mode device to connect. Please have a look at the latest code in the develop branch. You can see how to use WindowsDeviceConstants.GUID_DEVINTERFACE_USB_DEVICE to get a list of connected devices.
Device.Net/src/Device.Net.UnitTests/IntegrationTests.cs
Line 45 in fc000a2
Can this issue be closed?
MelbourneDeveloper commentedon Nov 21, 2020
This has been fixed. You have to specify the class guid when listing devices