Tamer
Tamer

Reputation: 105

UWP SerialDevice.FromIdAsync return null

I'm trying the Microsoft sample for Serial Port and it's working on Raspberry Pi2 but not on local machine , on,local machine return null.

the DeviceCapability already added, that's why it's working on Pi2.

any idea why it's not working on local machine

local system: Win10 Ent. VS 2015.3

Upvotes: 2

Views: 961

Answers (1)

Tamer
Tamer

Reputation: 105

I found this answer :(

Link

System-internal or on-chassis serial ports may be enumerated by DeviceInformation.FindAllAsync(), but cannot be opened by SerialDevice.FromIdAsync() because they currently are not supported. However, serial ports connected over USB, such as on USB-to-Serial cables are supported.

Update : the issue still there even after the updates untill now

Serial ports marked as internal to the machine (DEVPKEY_Device_InLocalMachineContainer == TRUE) are not accessible unless explictly marked by the vendor driver as unrestricted (DEVPKEY_DeviceInterface_Restricted == TRUE). Devices connect via most PCI COM port expansion cards are therefore not accessible.

Inaccessible serial ports may still be enumerated by DeviceInformation.FindAllAsync(), but cannot be opened by SerialDevice.FromIdAsync(). Attemping to open such a device will either throw an exception or return null. Apps should handle this case by filtering such serial ports from the user's view, so that the user will not be able to interact with such an unsupported serial port.

Upvotes: 3

Related Questions