堆栈独立的 c/c++蓝牙API?
我想知道是否有适用于 Windows(XP、Vista、7、x86 和 x64)的堆栈独立 C/C++ 蓝牙 api。
我的目标是创建连接并通过蓝牙发送/接收一些时间关键的数据。
我的研究为我提供了以下选项,但此任务存在缺点:
- Windows 蓝牙套接字
仅适用于微软蓝牙堆栈 - 使用 COM 端口(CreateFile/ReadFile/...)
比套接字选项和用户必须首先连接到设备。 - 使用堆栈相关的 API
这需要检测使用的堆栈并为每个堆栈创建读/写函数。非常耗时,我不知道是否可以支持所有堆栈 - 编写 KMDF 驱动程序
我考虑编写一个功能驱动程序来直接与蓝牙 HCI 驱动程序对话,该驱动程序应该与堆栈无关。这将非常耗时,因为我必须阅读整个蓝牙规范,或者是否有用于 HCI 命令的 API?
我知道 btframework.com 也有一个商业 sdk,它支持大多数(或全部)蓝牙堆栈,但我需要一个免费软件选项。
请告诉我是否还有其他选项可以完成此任务。
如果没有,您能告诉我您更喜欢哪些选项以及为什么吗?
是否可以使用 Windows Sockets 并忽略其他蓝牙堆栈?
感谢您的帮助 :)
I wanted to know if there is any stack independent C/C++ bluetooth api for windows (XP, Vista, 7, x86 and x64).
My target is to create a connection and send/receive some time critical data over bluetooth.
My researches gave me the following options and there disadvantage for this task:
- Windows Sockets for Bluetooth
Only works with microsoft bluetooth stack - Using the COM port (CreateFile/ReadFile/...)
Slower than the socket option and the user has to connect to the device first. - Use stack dependent API
This would require to detect the used stack and create read/write functions for every stack. Very time consuming and I don't know if it is even possible to support all stacks - Writing a KMDF driver
I thought about writing a function driver to talk directly with the bluetooth HCI driver which should be stack independent. This would be very time consuming because I would have to read the whole bluetooth spec, or is there an API for the HCI commands?
I know that there is also a commercial sdk from btframework.com which supports most (or all) bluetooth stacks, but I need a freeware option.
Please tell me if there are any other options for this task.
If there aren't any, could you tell me which options you would prefer and why?
Is it okay to use Windows Sockets and ignore the other bluetooth stacks?
Thanks for your help :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想一种选择是使用 C++/CLI 与我的托管蓝牙库 32feet.NET 进行交互,该库支持 Windows 上的大多数堆栈。 http://32feet.codeplex.com/
I guess one option would be to use C++/CLI to interface with my managed Bluetooth library 32feet.NET which supports most of the stacks on Windows. http://32feet.codeplex.com/
我已经成功地使用了这个库,它被称为WCL,但它不是免费的。这样您就可以通过 SPP 进行连接,而无需创建虚拟 COM 端口。
虽然他们的文档不是很好,但他们提供了一些您可能想尝试的很好的演示代码。
它支持 Microsoft、Toshiba、Widcomm 和 Bluesoleil 堆栈,并且有一个本机 C++ 实现(以及 .NET 实现)。
I've been successfully using this library it is called WCL but it is not free. With this you can connect through SPP without requiring to create a virtual COM port.
While their documentation is not very good, they provide some good demo code that you may want to try.
It supports the Microsoft, Toshiba, Widcomm and Bluesoleil stacks and there is a native C++ implementation (as well as a .NET one).