title: Windows 10: HID Communication in C#
body: <p>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. </p>
  
  <p>Package.appxmanifest:</p>
  
  <pre><code>&lt;DeviceCapability Name="humaninterfacedevice"&gt;
      &lt;Device Id="vidpid:16C0 0486"&gt;
        &lt;Function Type="usage:FFAB 0200"/&gt;
      &lt;/Device&gt;
  &lt;/DeviceCapability&gt;
  </code></pre>
  
  <p>MainPage.xaml.cs</p>
  
  <pre><code>HidInputReport testReport = await device.GetInputReportAsync();
  
  DataReader dataReader = DataReader.FromBuffer(testReport.Data);
  byte[] fileContent = new byte[dataReader.UnconsumedBufferLength];
  dataReader.ReadBytes(fileContent);
  
  textBlock.Text += System.Text.Encoding.UTF8.GetString(fileContent);
  </code></pre>
  
  <p>This method of reading is what the MSDN articles used as well, but it's not providing me any results. If anyone has insight in to what I could do different or am doing wrong it would be much appreciated!</p>
  
  <p><strong>EDIT:</strong> Just adding a bit more information here, I have setup an event to trigger upon receiving the InputReport, and the event triggers at the set interval that I am sending messages from the Arduino which leads me to believe it is the correct packet/message/data. The one issue is that this data is always empty, despite me having verified that an actual non-zero message is being sent. </p>