Author Topic: HID Communication on Arduino Leonardo to Windows 10  (Read 12316 times)

karolys

  • Member
  • ***
  • Posts: 2
HID Communication on Arduino Leonardo to Windows 10
« 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:

Code: [Select]
<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!

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: HID Communication on Arduino Leonardo to Windows 10
« Reply #1 on: August 25, 2015, 09:15:27 pm »
"I do receive the appropriate communication event" - what API are you using to read the data? Does the function return an error message?

 


karolys

  • Member
  • ***
  • Posts: 2
Re: HID Communication on Arduino Leonardo to Windows 10
« Reply #2 on: August 26, 2015, 02:08:51 pm »
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

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: HID Communication on Arduino Leonardo to Windows 10
« Reply #3 on: August 26, 2015, 03:27:29 pm »
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.


Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: HID Communication on Arduino Leonardo to Windows 10
« Reply #4 on: August 28, 2015, 08:59:44 am »