// the find
labapart/gattlib
Library to access GATT information from BLE (Bluetooth Low Energy) devices
GattLib is a C library that wraps BlueZ's GATT implementation to give you a consistent API for reading, writing, and subscribing to BLE characteristics on Linux. It targets embedded Linux and Raspberry Pi-style projects where you need to talk to a BLE sensor or peripheral without writing D-Bus boilerplate. Python bindings are available via PyPI.
Abstracts the BlueZ v4/v5 API split cleanly — same calling code works across a wide range of kernel/BlueZ versions. The D-Bus backend (v5.40+) is the right architectural call; it avoids the deprecated direct HCI socket approach that breaks on modern kernels. Python bindings are a real value-add for IoT scripting use cases. Examples cover the practical 80%: scan, connect, discover, read/write, notify.
Last commit July 2024 and the TODO still lists removing GLib as a dependency — that's been sitting there for years, meaning you're pulling in GLib whether you want it or not. No async/callback API worth mentioning; notification handling is callback-only with no event loop integration beyond GLib's mainloop, which is awkward if your app already runs a different loop. The test suite is a single continuous-connection stress test with no unit coverage — the CI is essentially 'does it compile'. macOS/Windows are non-starters; this is Linux-only and the docs don't say so prominently enough.