我正在編寫一個WPF應用程序(不是UWP),我需要運行BluetoothLE。c#:WPF中的BluetoothLe:找不到某些類/方法
我加入了藍牙usings:
using Windows.Devices.Bluetooth;
using Windows.Devices.Bluetooth.GenericAttributeProfile;
,我加入到C中的參考文獻:\程序文件(x86)\參考大會\微軟\ Framework.NETCore \ V4.5 \ System.Runtime .WindowsRuntime.dll 和C:\ Program Files(x86)\ Windows Kits \ 10 \ UnionMetadata \ Facade \ Windows.WinMD。
但現在兩個錯誤occure:
var gattServicesResult = await device.GetGattServicesForUuidAsync(new Guid(RX_SERVICE_UUID));
給出了錯誤「BluetoothLedevice」不包含「GetGattServicesForUuidAsync」的定義[...](是否缺少using指令或程序集引用? )
和
GattWriteResult result =
await characteristic.WriteClientCharacteristicConfigurationDescriptorWithResultAsync(GattClientCharacteristicConfigurationDescriptorValue.Notify);
給出了錯誤類型或namesp ace name'GattWriteResult'找不到(您是否缺少使用指令或程序集引用?)
我也嘗試了UwpDesktop。
任何想法什麼是什麼?任何幫助感謝!
這不提供問題的答案。一旦你有足夠的[聲譽](https://stackoverflow.com/help/whats-reputation),你將可以[對任何帖子發表評論](https://stackoverflow.com/help/privileges/comment);相反,[提供不需要提問者澄清的答案](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can- I-DO-代替)。 - [來自評論](/評論/低質量帖/ 17901071) – Jodocus
你是對的,但我沒有足夠的聲譽。順便說一下,我解決了同樣的問題 – nikname