Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UWP HID SendOutputReport always returns access denied, requires ReadWrite permissions

Tags:

uwp

hid

wiimote

I'm trying to read a Wii Remote using the HID class, in a UWP app (C# .net), similar to this.

However, I can't seem to do much, as I can't get a Write-capable HID handle, which is required to do a HID SendOutputReport (needed for the device configuration).

I've tried several permissions combinations, I can read just fine with the current permissions in the manifest, but I've yet to be able to write.

I've also tried messing with selectors, to see if there was another possible handle available that could be written, but alas, nothing.

Any insight would be very appreciated.

Public discussion. Similar issue

The current permissions I'm using look like this.

<Capabilities>
    <DeviceCapability Name="bluetooth" />    
    <DeviceCapability Name="humaninterfacedevice">
      <!-- Any generic gaming device  -->   
      <Device Id="any">
        <Function Type="usage:0004 *"/>
        <Function Type="usage:0005 *"/>
      </Device>
      <!--Wii Remote Device-->
      <Device Id="vidpid:057E 0306 bluetooth">
        <Function Type="usage:0005 *" />
        <Function Type="usage:0001 0005" />
        <Function Type="usage:0002 *" />
        <Function Type="usage:0003 *" />
        <Function Type="usage:0004 *" />
        <Function Type="usage:0006 *" />
        <!--<Function Type="usage:0007 *" />-->
        <Function Type="usage:0008 *" />
        <Function Type="usage:0009 *" />
        <Function Type="usage:000A *" />
        <Function Type="usage:000B *" />
        <Function Type="usage:000E *" />
        <Function Type="usage:000f *" />
        <Function Type="usage:0010 *" />
        <Function Type="usage:0011 *" />
        <Function Type="usage:0012 *" />
        <Function Type="usage:0013 *" />
        <Function Type="usage:0014 *" />
        <Function Type="usage:0015 *" />
        <Function Type="usage:0016 *" />
        <Function Type="usage:0017 *" />
        <Function Type="usage:0018 *" />
        <Function Type="usage:0019 *" />
        <Function Type="usage:001A *" />
        <Function Type="usage:001B *" />
        <Function Type="usage:001C *" />
        <Function Type="usage:001D *" />
        <Function Type="usage:001E *" />
        <Function Type="usage:001F *" />
        <Function Type="usage:0021 *" />
      </Device>
    </DeviceCapability>
  </Capabilities>

EDIT: Added similar issue.

like image 533
MoDu Avatar asked Jan 22 '18 16:01

MoDu


1 Answers

I'm currently working on the same problem for the switch controller. At least for the switch controller it uses the UsagePage 0x01.

Looking at some #defines as pasted here. This number translates to HID_USAGE_PAGE_GENERIC

Looking at the MS Documentation it says it restrict access to some page which includes the required :/

So if the wiimote uses the same page as the joycon, it looks bad.


I still hope you find a solution, I could use one too.

like image 82
lokimidgard Avatar answered Dec 21 '22 23:12

lokimidgard