Bluetooth in C++

99封情书 提交于 2019-12-04 21:08:21

问题


I am looking to communicate via RFCOMM to another Bluetooth device. I want to use C++ (VS2008) for the application. I already know of the 32feet library, but was unsure if it would work for C++. Does anyone know of a good starting point for this kind of project? Or possibly 32feet samples written in C++? I want a simple, easy to use API for Bluetooth using C++.


回答1:


You can do Bluetooth programming using BT sockets into the OS Bluetooth stack. This page discusses socket usage: http://msdn.microsoft.com/en-us/library/windows/desktop/aa362928(v=vs.85).aspx

This page has links to download Bluetooth SDK from Microsoft: http://msdn.microsoft.com/en-us/library/windows/desktop/aa363058(v=vs.85).aspx




回答2:


This question is rather old, I know.

Just wanted to update, that Qt Framework has now Qt Bluetooth for C++ that looks very promising -- http://doc.qt.io/qt-5/qtbluetooth-module.html




回答3:


Building apps using the Microsoft stack works fairly well (XP and Vista work great, trying to run the same apps under Windows 7-64bit does not work so well...)

The real advantage to 32feet.net is that the Bluetooth support on Windows is heavily Balkanized - you never know on a given machine whether it is using the Microsoft, Broadcom, Toshiba, BlueSolei, or some other stack. While these are all mostly compatible over-the-air, the APIs are completely different for each. Building with 32feet.net lets your application run on a larger subset of machines... That said, I have not tried building it into a C++ application - sorry.



来源:https://stackoverflow.com/questions/10254910/bluetooth-in-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!