How to connect to device with BlueZ in C?

Viewed 72

Is there a sample code for connecting to ble device using bluez with C code? http://www.bluez.org/release-of-bluez-5-64/ I reviewed the software here, but it was very comprehensive and difficult to understand. Is there a simpler software?

1 Answers

Another way to do this is to get familiar with the BlueZ command line tools (especially bluetoothctl), and then read the source code for this tool to understand how BLE operations (including BLE) are implemented. You can find info on how to use bluetoothctl here:-

You can then download the source code (available here), and view the code for connection using bluetoothctl (found here).

Alternatively, you can search for the BlueZ C function for connecting to Bluetooth devices (ConnectDevice), and download simple examples from the web. This is something I found using a quick search:-

Related