WPF中的蓝牙低功耗设备

时间:2019-09-27 03:09:46

标签: wpf uwp bluetooth-lowenergy

我必须使用低功耗蓝牙(BLE)和WPF创建一个桌面应用程序。根据我的研究,Microsoft BLE API'不适用于WPF.Microsoft具有丰富的UWP API。那么我们可以在WPF上使用UWP BLE APIS吗? 我尝试使用Windows运行时组件,但没有一点运气。

1 个答案:

答案 0 :(得分:0)

Windows.Devices.Bluetooth API是DualApiPartitioned的,这意味着可以从桌面应用程序调用该API。因此,当您要使用BLE API时,可以尝试在WPF中添加以下引用。

System.Runtime.WindowsRuntime, in: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\System.Runtime.WindowsRuntime.dll
Windows, in: C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Facade\Windows.WinMD​
Windows.Foundation.FoundationContract, in: C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0\Windows.Foundation.FoundationContract\3.0.0.0\Windows.Foundation.FoundationContract.winmd​
Windows.Foundation.UniversalApiContract, in: C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0\Windows.Foundation.UniversalApiContract\8.0.0.0\Windows.Foundation.UniversalApiContract.winmd

有关更多详细信息,您可以阅读此link