I wonder if it is possible to discover unpaired Bluetooth devices programmatically within a Windows 10 tablet application.
I really don't want to pair by Settings -> Devices -> Bluetooth.
Unfortunately I couldn't find any documentation/example that would have helped.
I tried to search for Bluetooth devices by using the BluetoothLEAdvertisementWatcher but I wasn't able to find any. Probably because these devices were no BluetoothLE devices. Thought these were compatible.
Also I thought it would be possible to create a CLI/C++ wrapper that I could reuse in my UWP application but I feel very uncertain about that as not the whole (especially the interfacing part of the) Win32 API is re-usable in UWP environment.
At a last option I thought there must be a way to just get the list of devices that Windows generates when entering Settings -> Devices -> Bluetooth and I tried to achieve that by using a DeviceWachter but without success.
Now I am very desperate. For my application it would be horrible to manually pair each and every device before using it. I cannot understand why Microsoft cuts the developers so enormous.
Thanks in advance for your help.
I wonder if it is possible to discover unpaired Bluetooth devices programmatically within a Windows 10 tablet application.
Yes, it's possible.
I tried to search for Bluetooth devices by using the BluetoothLEAdvertisementWatcher but I wasn't able to find any. Probably because these devices were no BluetoothLE devices.
You used a wrong watcher. What you need is DeviceWatcher, not BluetoothLEAdvertisementWatcher. The difference between them is that the DeviceWatcher
is for enumerating devices dynamically, while the BluetoothLEAdvertisementWatcher
is for receiving Bluetooth Low Energy (LE) advertisements.
There is an official Device enumeration and pairing sample, you can refer to scenario 8 of this sample, this sample is absolutely what you need.