问题描述
我的目标是验证设备是否有蓝牙,如果有,则验证蓝牙是打开还是关闭。为此,我使用了以下代码片段。
public async Task<bool> GetBluetoothStatusAsync()
{
var allRadio = await Radio.GeTradiosAsync();
if (allRadio == null) return false;
var bluetoothRadio = allRadio.FirstOrDefault(radio => radio.Kind == RadioKind.Bluetooth);
return bluetoothRadio != null && bluetoothRadio.State == RadioState.On;
}
从桌面 Win32 应用程序调用时它不起作用。 如果目标平台设置为 x64,Windows.Devices.Radios 工作正常,但对于 x86,它不起作用。从 windows git issues 看来,这是一个已知问题,尚未解决。是否有解决此问题的方法?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)