I upgraded to the official release of Windows 10, version 1703 build 15063 (Creators Update). When I run the following code in a working WPF application, BluetoothLEDevice.FromBluetoothAddressAsync never returns.
This code worked fine until my Windows 10 update (i.e. the previous 1607 compilation 14393). This code also works great if it works like UWP in the new Win 10 1703.
BluetoothLEAdvertisementWatcher BleWatcher = null;
private void Button_Click(object sender, RoutedEventArgs e)
{
BleWatcher = new BluetoothLEAdvertisementWatcher
{
ScanningMode = BluetoothLEScanningMode.Active
};
BleWatcher.Received += Watcher_Received;
BleWatcher.Start();
}
private async void Watcher_Received(BluetoothLEAdvertisementWatcher sender,
BluetoothLEAdvertisementReceivedEventArgs args)
{
var device = await BluetoothLEDevice.FromBluetoothAddressAsync(args.BluetoothAddress);
}
I have completed the instructions here qaru.site/questions/1016707 / ... , to customize my desktop WPF application to use API UWP.
, WPF , Win 10 1703, exe .
- Windows 10 1703 ( UWP)?
, BluetoothAddressType.Public 2nd FromBluetoothAddressAsync, , .
var device = await BluetoothLEDevice.FromBluetoothAddressAsync(args.BluetoothAddress, BluetoothAddressType.Public);