SerialDevice.FromIdAsync( ) is always returning null due to "Access to the device was blocked by the system : \?\USB#VID_1546&PIC_01A8#5&46E708A&0&10#{86e0d1e0-8089-11d0-9ce4-08003e301f73}"
I did request access to the device in the UWP application manifest...
But, _device is always getting assigned null, in the following code...
public async Task AttachedToGps()
{
const uint baudRate = 9600;
const ushort dataBits = 8;
const SerialParity parity = SerialParity.None;
ushort vid = 0x1546;
ushort pid = 0x01A8;
var selector = SerialDevice.GetDeviceSelectorFromUsbVidPid(vid, pid);
var devices = await DeviceInformation.FindAllAsync(selector);
if (devices.Any())
{
var deviceInfo = devices.First();
_device = await SerialDevice.FromIdAsync(deviceInfo.Id);
_device.BaudRate = baudRate;
_device.DataBits = dataBits;
_device.Parity = parity;
_device.ReadTimeout = TimeSpan.FromMilliseconds(500);
_device.WriteTimeout = TimeSpan.FromMilliseconds(500);
_deviceChannel = new NmeaParser.SerialPortDevice(_device);
}
return _deviceChannel;
}
What more do I need to do, to get access to this serial communications device? This source code did work on an older version of the device (and Windows 10 Pro O/S).
Many thanks to anyone that can help!