gatttool LTK, IRK, GAP doubts?

677 Views Asked by At

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.

  1. What does sec-level in gatttool means? How it is related to security mechanisms of BLE Core specification (Just Works, Passkey and OOB)? How it is related to various security modes and levels of BLE?
  2. How can i initiate bonding and pairing using gatttool? (You can point our command line arguments to command gatttool).
  3. How can i access GAP profile using gatttool?
  4. Is service discovery integrated in gatttool?
  5. How can i manage/access peer's and own LTK and IRK?
1

There are 1 best solutions below

2
On BEST ANSWER

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.