Stack independent c/c++ bluetooth api?
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 BluetoothOnly works with microsoft bluetooth stack
- Using the COM port (CreateFile/ReadFile/...)Slower than the socket opt开发者_StackOverflow社区ion and the user has to connect to the device first.
- Use stack dependent APIThis 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 driverI 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 :)
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/
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).
精彩评论