I am using bluez
for writing a BLE application. I have read the source code of gatttool
. I have few doubts regarding it and bluez
.
- What does
sec-level
in gatttool means? How it is related to security mechanisms of BLE Core specification (Just Works
,Passkey
andOOB
)? How it is related to various security modes and levels of BLE? - How can i initiate bonding and pairing using
gatttool
? (You can point our command line arguments to commandgatttool
). - How can i access
GAP
profile usinggatttool
? - Is
service discovery
integrated ingatttool
? - How can i manage/access peer's and own LTK and IRK?
You don't have to build you application around gatttool and what's included in it.
Bluez5 exposes interfaces in the DBus. Using this dbus api and with the dbus bindings in the language of your choice (C, python, C#Mono) you can pretty much do everything =)
You can find a description of the dbus api exposed by bluez here : https://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc
You can find the source code of bluetoothctl (a tool that you can use for pairing, connecting, services discovery, gatt attributes reading & writing etc) here : https://git.kernel.org/cgit/bluetooth/bluez.git/tree/client/main.c
bluetoothctl was built using GLib GDBus (dbus bindings for Glib in C) and you will find code examples for pretty much everything.