Is there any way to use Bluetooth LE from a c# desktop app in windows 10?

后端 未结 2 558
难免孤独
难免孤独 2020-12-01 19:33

Everything I found online regarding bluetooth LE requires a universal windows app, which is completely unsuitable for me.

Is there a way to use bluetooth LE from c#

2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-01 20:22

    You can use C# APIs in C# Desktop applications! I have a sample here in GitHub.

    In general, to get access to the C# APIS, add two references to your project:

    1. C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Windows.winmd
    2. C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\System.Runtime.WindowsRuntime.dll

    Note that the #2 version depends on the version of .NET that you're using.

    Background tasks will not be supported, but all other Bluetooth C# features should be there.

提交回复
热议问题