Having an issue with Windows 10 UWP C# programming to access a HID USB device.
- I have no problem to find a device (GetDeviceSelector, DeviceInformation) and no trouble to open the device (FromIdAsync).
- I can also send it an output report no problem (CreateOutputReport, add an array of bytes for message, SendOutputReportAsync) and the USB device reacts correctly by turning on a LED.
- I am not able to read back the input report (GetInputReportAsync) no matter what I try including different report IDs. The device is still valid and not null when trying to do this.
I have double checked the VID, PID, Usage Page and ID. None of these are violating anything that I can find in the docs, not trying to use top level usage pages.
I have double checked the firmware in the device and its USB descriptor. The Device Manager is happy in Windows 7 or 10, no issues reported. I can access the device in Windows 7 or 10 via an interface DLL I wrote with the Windows DDK for use with Windows 7 and a test app and send/receive just fine in Windows 7 or 10. I can set LED, read back values, etc., all functions work.
I have connected a USB analyzer and the packets are there, but the GetInputReportAsync function will not return any data, just an exception "A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)"
Using Window 10 Home, developer mode enabled. Have tried Visual Studio 2015 Community Edition and the VS 2015 Pro trial. I have tried the Windows-universal-samples-master on GitHub and the CustomHidDeviceAccess project, no luck, my device is a bit different than the one used in this demo.
Has anybody seen this before? Is there some trick or special way to do this? Is there a setting I am missing in Windows 10 or my project? Are there certain usage pages in the hex FF?? range that I cannot use with UWP? Or certain report IDs? Just wondering why I am always getting an exception when trying to get the input report via C# UWP and why my DDK DLL/app always works. Suggestions? Thx.