[UWP] [C ++]没有配对的C ++ UWP蓝牙通信 [英] [UWP][C++]C++ UWP Bluetooth communication without pairing

查看:116
本文介绍了[UWP] [C ++]没有配对的C ++ UWP蓝牙通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

我有一个用C ++编写的应用程序,它与蓝牙设备通信。它使用BT Classic(rfcomm)和BT Low Energy。唯一的落后是用户应该首先在Windows设置中配对BT设备才能在应用程序中使用。

I have an app written in C++ which communicates with bluetooth devices. It uses BT Classic (rfcomm) and also BT Low Energy. The only backward is that the user should pair the BT device first in windows settings in order to use in the app.

我发现可以在没有配对的情况下进行通信(BT LE):  ; https://docs.microsoft.com/en-us/windows/uwp / devices-sensors / gatt-client  

I found that it's possible to communicate without pairing (BT LE): https://docs.microsoft.com/en-us/windows/uwp/devices-sensors/gatt-client 

我发现这也适用于BT Classic:  https://github.com/Microsoft/Windows-universal-samples/tree/dev/Samples/BluetoothRfcommChat

and I found that this is possible with BT Classic also: https://github.com/Microsoft/Windows-universal-samples/tree/dev/Samples/BluetoothRfcommChat

唯一的问题是文档中的这些示例代码以及示例应用程序都在C#中。最后我的问题是:是否可以与BT LE设备(可能还有BT Classic设备)进行通信而无需在
C ++ 中与它配对?

The only problem is that these example codes in the docs and also the sample app is in C#. So finally my question: is it possible to communicate with BT LE device (and maybe with BT Classic device) without pairing with it in C++?

谢谢!

推荐答案

嗨Szasz,

Hi Szasz,

我不确定为什么只有C#样本。但我建议您可以尝试用C ++编写它,因为我可以在这里找到C ++蓝牙API:
https://docs.microsoft.com/en-us/uwp/api/windows.devices.bluetooth

I'm not sure why there is only C# sample for this. But I suggest that you could try to write it in C++ as I could find the C++ Bluetooth API here: https://docs.microsoft.com/en-us/uwp/api/windows.devices.bluetooth.

祝你好运,

Roy


这篇关于[UWP] [C ++]没有配对的C ++ UWP蓝牙通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆