.Net(C#)中的蓝牙低功耗 [英] Bluetooth Low Energy in .Net (C#)
问题描述
是否可以在控制台应用程序中将蓝牙低功耗(ble)与.Net(C#)一起使用?例如,在uwp应用程序中使用windows.devices.bluetooth这样的示例。
is it possible to use bluetooth low energy (ble) with .Net (C#) in an console app? For Example like with windows.devices.bluetooth in uwp apps.
我只是在uwp中做到这一点,但我需要vJoy,它是为.Net和MbientLab Metawear设计的
I would just do it in uwp, but I need vJoy which is designed for .Net and the MbientLab Metawear C hardware as sensor with ble.
推荐答案
您可以在C#桌面应用程序中使用C#API!我在GitHub中有一个示例。
You can use C# APIs in C# Desktop applications! I have a sample here in GitHub.
通常,要访问C#APIS,请为您的项目添加两个引用:
In general, to get access to the C# APIS, add two references to your project:
- C:\Program Files(x86)\ \Windows套件\10\UnionMetadata\Windows.winmd
- C:\Program Files(x86)\参考程序集\Microsoft\Framework.NETCore\v4。 5\System.Runtime.WindowsRuntime.dll
请注意,#2版本取决于您所使用的.Net版本
Note that the #2 version depends on the version of .Net that you're using.
不支持后台任务,但是所有其他Bluetooth C#
功能都应该存在。
Background tasks will not be supported, but all other Bluetooth C# features should be there.
这篇关于.Net(C#)中的蓝牙低功耗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!