while i use the API : var PDevice = PhoneLineTransportDevice.FromId, it return null

Mingping1 Zhang 0 Reputation points
2024-04-18T15:10:46.03+00:00

I use the below codes, try to get the PhoneLineTransportDevice, but the API FromID returns null

//this API works well, can get the DeviceInformation

DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(PhoneLineTransportDevice.GetDeviceSelector(PhoneLineTransport.Bluetooth));

//this PDevice is always null, can't create the PhoneLineTransportDevice by FromID API, I am sure //the device[0].Id is correct, and the same codes can work well on some other PCs

var PDevice = PhoneLineTransportDevice.FromId(devices[0].Id);

would you like to help give some advice ?

1, why does the FromID API always return null?

2, How to solve it ?

thanks very much

Universal Windows Platform (UWP)
{count} votes