You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Scenario2_DeviceConnect.xaml.cs includes the function private void CloseFx2Device().
This function does not really close the device. It sends a notification to the user and then calls the ClearSelectedDevice() function of the DeviceList-singleton, which in turn calls SetSelectedDevice(null, null). Doing so triggers the DeviceClosing-Event (to which, as far as I can see nobody is attached) and sets some members to null. There is no code that closes the Device.
Subsequent tries to open the same device fail with an AccessDeniedExeption.
To Reproduce
var device = await CustomDevice.FromIdAsync(Id, DeviceAccessMode.ReadWrite, DeviceSharingMode.Exclusive);
device = null;
device = await CustomDevice.FromIdAsync(Id, DeviceAccessMode.ReadWrite, DeviceSharingMode.Exclusive);
this will throw an Exception
Expected behavior
The function CloseFx2Device() should somehow close the device. As CustomDevice itself does not provide such functionality, I suppose there should be some other mechanism to close the device.
The text was updated successfully, but these errors were encountered:
Which sample are you reporting a bug in?
Example: Custom Capability
Describe the bug
Scenario2_DeviceConnect.xaml.cs includes the function private void CloseFx2Device().
This function does not really close the device. It sends a notification to the user and then calls the ClearSelectedDevice() function of the DeviceList-singleton, which in turn calls SetSelectedDevice(null, null). Doing so triggers the DeviceClosing-Event (to which, as far as I can see nobody is attached) and sets some members to null. There is no code that closes the Device.
Subsequent tries to open the same device fail with an AccessDeniedExeption.
To Reproduce
var device = await CustomDevice.FromIdAsync(Id, DeviceAccessMode.ReadWrite, DeviceSharingMode.Exclusive);
device = null;
device = await CustomDevice.FromIdAsync(Id, DeviceAccessMode.ReadWrite, DeviceSharingMode.Exclusive);
this will throw an Exception
Expected behavior
The function CloseFx2Device() should somehow close the device. As CustomDevice itself does not provide such functionality, I suppose there should be some other mechanism to close the device.
The text was updated successfully, but these errors were encountered: