I am trying to port a library from classic desktop to UWP. It all works like planned except for one thing. When I try to open a HID connection to the device(A wiimote) it won't connect if the permissions are on readwrite. It does work with read only permissions.
What could be the problem. The permissions in the manifest are set to the correct values.
EDIT: I checked the DeviceAccessStatus to see if the permissions are not good but it returns DeviceAccessStatus.Allowed
Manifest code
<Capabilities>
<Capability Name="internetClient" />
<DeviceCapability Name="humaninterfacedevice">
<Device Id="any">
<Function Type="usage:0005 *"/>
<Function Type="usage:0001 0005"/>
</Device>
</DeviceCapability>
</Capabilities>
Connection code
var selector = HidDevice.GetDeviceSelector(1, 5);
var devices = await DeviceInformation.FindAllAsync(selector);
if (devices.Count > 0)
{
foreach (var device in devices)
{
var deviceId = device.Id;
var foundDevice = await HidDevice.FromIdAsync(deviceId, FileAccessMode.ReadWrite); // Does not work always returns null
if (foundDevice == null)continue;
// if the vendor and product IDs match up
if (foundDevice.VendorId == VID && foundDevice.ProductId == PID)
{
// Unrelated code
ReadWrite
permission on your device? – Lydon