UWP HID SendOutputReport always returns access denied, requires ReadWrite permissions
Asked Answered
P

1

9

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.

Pickford answered 22/1, 2018 at 16:30 Comment(0)
H
2

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.

Hassett answered 22/1, 2018 at 21:0 Comment(2)
"the wiimote uses the same page as the joycon" - Pretty sure the wiimote is exactly on pages 0x04 and 0x05, the same as generic game controller. Is this the wiimote abusing the HID specification (it was never made to conform anyway)?Pickford
@Pickford Sorry it took so long to respond wasn't on my machine for some days. I just checked again using UssagePage 0x04 or 0x05 in my selector yilds no result. Only 0x01 works. And in the GitHub repo you linked, is also ussagePage 0x01 used. The First parameter of GetDeviceSelector(...) is UssagePage. The seccond parameter were you use 5 is ussage Id.Hassett

© 2022 - 2024 — McMap. All rights reserved.