Reputation: 851
I checked theusr/include/bluetooth
folder and found the HCI library, but I am looking for the GATT library for use in my C application.
What should I do, or where should I look, in order to be able to use the BlueZ GATT library in my C application on linux?
My OS is Linux raspberrypi 4.1.13-v7+ #826 SMP PREEMPT armv7l GNU/Linux
.
Upvotes: 1
Views: 928
Reputation: 2299
Install BlueZ user space package with the experimental flag enabled. If you're going to use C you can use DBus to interact with the GATT Manager.
For a lower level approach, you could use the tools/btgatt-client.c
and tools/btgatt-server.c
as references to how to handle GATT in your project.
Running bluetoothctl
or gatttool
will also present you with options for GATT. The source for these files can also be found in the BlueZ user space source code.
Moreover, BlueZ is moving away from making user space applications use raw HCI/ioctl calls, this is now done through a new API, called the mgmt API. Documentation for this, and GATT-related things can be found in the /doc
folder of the aforementioned user space source. For more information on the shift to these new methods of developing user space applications see here.
Upvotes: 2