Implement a Bluetooth 4 host/application with a COTS dongle?

797 views Asked by At

I haven't found any very good resources in my search for answers to this question. At present I am using a TI CC2540 HCI over COM Port. I would like to move away from this solution for cost reasons. Commercial bluetooth low energy USB dongles can be had for very cheap. Let's use a CSR8510-based device for example.

I would like to implement the host and application with the CSR8510 dongle acting as the 'controller'. It does not use a serial port for HCI transport. How can I send/receive commands from this controller? CSR Support is not interested in discussing this because my quantities are too low (~10k)

I would like to specify certain low level options such as connection parameters, scan modes (limited discovery, general, etc.) so I need a relatively high level of control over the 'controller' dongle. Writing a kernel mode driver is not a route I can take.

Example dongle

1

There are 1 answers

2
Tim Tisdall On

The linux kernel will handle a lot of stuff for you if you open up an HCI socket. You can also open up L2CAP sockets to make connections to devices. Unfortunately the documentation is lacking (I've actually never found any), but the source code is fairly readable. Take a look at the Bluez gatttool to see how they access bluetooth dongles via sockets.

Note: there's a nasty bug in kernels <= 3.4 where multiple L2CAP connections get mixed together when using an L2CAP socket.

Here's a previous answer I gave to another question with some sample code: bluez with simultaneous classic and low energy devices