BluetoothLEDevice.FromIdAsync returning null

北城以北 提交于 2019-12-08 13:53:32
filotn

I got the same problem. the previous answer from Chi Lee is in fact good but not enough detailed on how to do it (for non-experts;-) ).

Here the detailed process (assuming you have a c# project under Microsoft visual studio):

  1. Double click the properties field under your project: this will open a new tab

  2. in the opened tab, select Application in the left then click Package Manifest... button

  3. A new tab named "package.appxmanifest" is opened. Select, inside it, the Capabilities tab
  4. Check Bluetooth field under capabilities

  5. Save and recompile your project.

The BluetoothLEDevice.FromIdAsync(di.Id) will no more return null, provided that you already have paired devices (either in your program or manually in Windows .

You have to add Bluetooth capability in your appxmanifest file.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!