如何在 Windows 10 通用应用程序上获取配对的蓝牙设备列表

msi*_*msi 5 c# bluetooth win-universal-app

我正在寻找如何在 Windows 10 通用应用程序中获取配对的蓝牙设备列表,但没有找到任何内容。有很多关于如何在 Windows 8.1 应用程序上执行此操作的信息,但没有一个解决方案适用于 Windows 10 通用应用程序。

msi*_*msi 6

我自己找到了答案。在西澳大学,配对蓝牙设备非常容易。这是代码片段:

var selector = BluetoothDevice.GetDeviceSelector();
var devices = await DeviceInformation.FindAllAsync(selector);
Run Code Online (Sandbox Code Playgroud)