Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stack independent c/c++ bluetooth api?


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 :)

like image 694
lolo Avatar asked May 08 '11 16:05

lolo


2 Answers

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/

like image 118
alanjmcf Avatar answered Sep 19 '22 14:09

alanjmcf


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).

like image 37
Jet Avatar answered Sep 22 '22 14:09

Jet