在类库中启用蓝牙功能

时间:2016-06-23 13:57:13

标签: c# bluetooth-lowenergy uwp windows-10-universal class-library

我正在开发一种可以检测出ble的uwp。 $xmlFilePath = 'your_path_here.xml' [xml]$xml = Get-Content $xmlFilePath $xml.ImageConfig.Image.ChildNodes | Where-Object Name -Match 'Software\d+' | ForEach-Object { $_.'#text' = '' } $xml.Save($xmlFilePath) 事件在我的应用中完美运行。我试图传输与蓝牙相关的代码,但我不知道如何在BluetoothLEAdvertisementWatcher.Received中启用蓝牙功能。如何在类库中启用该功能。

1 个答案:

答案 0 :(得分:0)

如果您正在使用visual studio,请右键单击您的项目文件,然后单击属性。然后在"包清单"导航到功能部分并在功能:

下检查蓝牙

否则你可以直接打开你的package.appxmanifest并添加这一行DeviceCapability Name =" bluetooth"在你的能力部分