HidDevice class GetInputReportAsync() Error RRS feed

  • Question

  • Using the following.

    Windows 10 Release
    Visual Studio 2015 RTM
    Developing application to communicate with USB HID device using the Microsoft HidDevice class

    Created application from blank Universal Application template for c#

    I can enumerate the device and connect fine.

    // Enumerate devices using the selector
     var devices = await DeviceInformation.FindAllAsync(selector);
    // Open the target HID device
     HidDevice device = await HidDevice.FromIdAsync(devices.ElementAt(0).Id, FileAccessMode.ReadWrite);
    // Save the device from the task to a global object so that it can be used later from other scenarios

    I can even send a number of different bytes and can see on the interface I am receiving these bytes and all working well.

    // Declare the output report
     var outputReport = DeviceList.Current.CurrentDevice.CreateOutputReport();            
     Byte[] outputBuffer = new Byte[1];
     // set Byte to 255 
     outputBuffer[0] = 0xFF;
     // Copies bytes from bytesToCopy to outputReport 
     WindowsRuntimeBufferExtensions.CopyTo(outputBuffer, 0, outputReport.Data, 1, outputBuffer.Length);
     // Send the output report
     await DeviceList.Current.CurrentDevice.SendOutputReportAsync(outputReport);

    But there is an error when trying to reads the buffer with GetInputReportAsync()

    // Read an input report
      var inputReport = await DeviceList.Current.CurrentDevice.GetInputReportAsync();

    The same happens when trying to use CreateFeatureReport()

    Any help appreciated.



    Wednesday, August 12, 2015 3:06 PM

All replies

  • Still cannot get GetInputReportAsync working and hunting around the internet, it seems I am not the only one.

    But using the Class HidInputReportReceivedEventArgs we can get the report back and have set it up as an interrupt within the application and works really well.

    Next issue is that the universal application works great when build for x86 CPU and tested on local machine.

    It simply has a button that sends a couple of bytes out to the HID device and receives a couple of bytes back. So a loopback test.

    Now on the x86 local machine all works well and any bytes sent get received and then send back the same values. They also flash certain LED's on the interface depending on what value is set.

    Next I compiled it for the Arm and deployed to the RaspberryPI 2 and the results are not good.
    The same tests were done and 90% of the time the bytes are not correct when received by the HID device.

    So for example we send out a byte with the value of 1 and the HID device seems to receive a 1 sometimes, but most other times it receives the values of 45 or 192 and also 0 every now and then.

    Anyone else working with universal apps and the Hid Device Class out there ?

    Thanks Sean.

    Friday, August 14, 2015 2:28 PM
  • Same problem here with Pi2 and HID Communication...

    Some News on this ?

    Sunday, August 30, 2015 12:28 PM
  • No news heard from this end, still developing Universal App this end and testing on Windows 10 and all working well. But not working on Pi2 :(

    Hoping this will get fixed, so we can actually run the final app on the Pi2 with USB comms.

    Monday, August 31, 2015 6:12 PM
  • Looks like we may have to ditch Windows 10 IOT and using the Raspberry PI for a project as there does seem to be a lot of issues that are not being addressed.

    Maybe later on we will try it again when there is better support and the issues have been sorted.

    With all Windows platforms we tend to wait before upgrading as the first releases are a bit buggy, but was hoping with the release of Windows 10 IOT that atleast the basics such as USB comms would of been ready.

    Looking at the Pipo x8 and x9 platorms that now dual boot to Windows 10 or Android OS and with the extra features such as built in Wifi, screen and touchscreen makes them very appealing cost and performance wise.

    • Edited by CNCDesignLtd Thursday, September 10, 2015 5:49 PM
    Thursday, September 10, 2015 5:46 PM
  • Okay new Windows 10 IOT Release 10.0.10531.0 now fixes these issues and USB HID works !

    Monday, September 28, 2015 8:22 AM