DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(PhoneLineTransportDevice.GetDeviceSelector(PhoneLineTransport.Bluetooth)); for (int i = 0; i < devices.Count; i++) { Console.WriteLine(i + "#: " + devices[i].Name + " " + devices[i].Id); } select: Console.WriteLine("Please input device id to select"); if (int.TryParse(Console.ReadLine(), out int s)) { if (s < 0 || s > devices.Count) { goto select; } Console.WriteLine("Selected: " + devices[s].Name + " " + devices[s].Id); } else { goto select; } var PDevice = PhoneLineTransportDevice.FromId(devices[s].Id); var result = await PDevice.RequestAccessAsync(); if (!PDevice.IsRegistered()) { PDevice.RegisterApp(); } var flag = await PDevice.ConnectAsync(); if (flag) { Console.WriteLine("Connected"); } else { Console.WriteLine("Could not connect to PhoneLineDevice"); } PhoneCallStore store = await PhoneCallManager.RequestStoreAsync(); PhoneLine pl = await PhoneLine.FromIdAsync(await store.GetDefaultLineAsync()); pl.DialWithOptions(new PhoneDialOptions { AudioEndpoint = PhoneAudioRoutingEndpoint.Bluetooth, Number = "18589846271" }); Console.ReadLine(); PDevice.UnregisterApp();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)