PORTS Forum
Ports and Interfaces => USB => Topic started by: karolys on August 25, 2015, 08:29:14 pm
-
Hello!
I'm cross posting this question in hopes that I run across someone that has more knowledge on the matter than I do. I'm attempting to establish communication over USB HID with an Arduino Leonardo using C# on Windows 10. I have been able to enumerate and retrieve the HidDevice object but I am unable to receive any data. I do receive the appropriate communication event but the bytes that are read are always empty.
My app manifest contains the following piece:
<DeviceCapability Name="humaninterfacedevice">
<Device Id="vidpid:16C0 0486">
<Function Type="usage:FFAB 0200"/>
</Device>
</DeviceCapability>
The remainder of my code(initialization and read handling) is very similar to what's available from MSFT resources on the topic. Any insight would be much appreciated!
-
"I do receive the appropriate communication event" - what API are you using to read the data? Does the function return an error message?
-
I am using the latest version of .NET targeting Universal Windows(10), specifically using Windows.Devices.HumanInterfaceDevice and related references.
https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn263133.aspx
-
If you are receiving a report, but the values aren't what you expect, a protocol analyzer will show you what the device is sending:
http://janaxelson.com/development_tools.htm#analyzers
A HID will send report data on receiving a token packet on the interrupt IN endpoint, assuming the endpoint has been armed to send data on receiving a token packet.
The Windows HID driver will accept a received report if the amount of data matches the report size in the report descriptor. If the report descriptor uses report IDs, the HID must send a report ID byte preceding the report data. If using the default report ID of zero, the report ID does not travel on the bus.
-
Maybe this will help:
https://forum.arduino.cc/index.php?topic=339139.0