using btstack as a BLE library on Windows pre-8

377 views
Skip to first unread message

Lubomir I. Ivanov

unread,
Jul 1, 2017, 4:36:42 PM7/1/17
to btstack-dev
hello,

i participate in the development of an open source project where we are about to implement BLE support for downloading information from small embedded devices.
ATM we support Windows XP and Windows 7 and we don't really want to drop support for these because of the lack of BLE API in older Windows.

i don't have experience with BLE so i'm going to be asking some questions on behalf of co-developers.

1) can btstack be used as a dynamic (DLL) or a static library on Windows?
i was able to use the makefile here with mingw:

but it builds a set of executables - e.g. le_counter.exe, hfp_hf_demo.exe

can all the object files (except main.o, i guess) be packed inside a AR library (.a) and used with some sort of API and header files? is the API documented? which header files are needed?

2) my understanding is that for one to enable BLE support on Windows pre-8 one has to have a spacial BLE dongle connected to a USB port and the software needs to communicate to it via something like HCI commands over a socket?
also a special variant of WinUSB driver needs to be installed (via a tool called Zadig - http://zadig.akeo.ie/). them i'm not exactly sure how GATT comes into play...

any more details on this subject? how does btstack deal with the lack of WINAPI support for BLE in older Windows?

3) are there source code examples for 2)?

thanks
lubomir
--

Matthias Ringwald

unread,
Jul 2, 2017, 4:53:32 AM7/2/17
to btsta...@googlegroups.com
Hi Lubomir

Yes, you can use BTstack on all Windows versions with an Bluetooth Controller (module) connected via (virtual) serial port and with most Windows versions (I think some from XP and later) to use an USB Bluetooth Dongle.

Zadig does not provide a special WinUSB driver. It is only a hack to stop Windows from taking control over the USB Bluetooth you want to use with BTstack.

Because BTstack directly talks to the Bluetooth controller, it doesn't care for the Windows Bluetooth APIs. For USB, it only needs the WinUSB driver to talk to the hardware.

Please see http://bluekitchen-gmbh.com/btstack/develop/integration/ about how it can be used with a single or multiple apps:

If you want to use BTstack with a single app/process on Windows, you can just add necessary source files to your main app project. You could also create a .dll or an .ar library if you like. The API is provided in the .h files. Just have a look at the examples and at the BTstack documentation.

If you need to use BTstack with more apps/processes, it gets a bit more complex, but there's also the Client/Server version in port/daemon. AFAIK, it does not support WinUSB, but it's not hard to add it to the configure.ac.

Hope this guides you into the right direction

Cheers
 Matthias


--
You received this message because you are subscribed to the Google Groups "btstack-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
To post to this group, send email to btsta...@googlegroups.com.
Visit this group at https://groups.google.com/group/btstack-dev.
For more options, visit https://groups.google.com/d/optout.

Lubomir I. Ivanov

unread,
Jul 2, 2017, 9:21:09 PM7/2/17
to btstack-dev

hello Matthias,

On Sunday, 2 July 2017 11:53:32 UTC+3, Matthias Ringwald wrote:
Hi Lubomir

Yes, you can use BTstack on all Windows versions with an Bluetooth Controller (module) connected via (virtual) serial port and with most Windows versions (I think some from XP and later) to use an USB Bluetooth Dongle.

Zadig does not provide a special WinUSB driver. It is only a hack to stop Windows from taking control over the USB Bluetooth you want to use with BTstack.

Because BTstack directly talks to the Bluetooth controller, it doesn't care for the Windows Bluetooth APIs. For USB, it only needs the WinUSB driver to talk to the hardware.

ok, this makes perfect sense.
 

Please see http://bluekitchen-gmbh.com/btstack/develop/integration/ about how it can be used with a single or multiple apps:

If you want to use BTstack with a single app/process on Windows, you can just add necessary source files to your main app project. You could also create a .dll or an .ar library if you like. The API is provided in the .h files. Just have a look at the examples and at the BTstack documentation.


understood, i guess we can just roll the required object code into a static library.
 
If you need to use BTstack with more apps/processes, it gets a bit more complex, but there's also the Client/Server version in port/daemon. AFAIK, it does not support WinUSB, but it's not hard to add it to the configure.ac.

Hope this guides you into the right direction


thanks for the detailed response!

lubomir
--

Reply all
Reply to author
Forward
0 new messages