title: BlueZ 5.30: D-Bus GATT API - Simply Discover and Connect to a BLE device in C
body: <p>With the last release of BlueZ (5.30) the highlight was the completion of the GATT D-Bus apis. My goal is to programmatically (in C), as a BLE client:</p>
  
  <ol>
  <li>scan for ble devices (which I can do with the hci layer)</li>
  <li>Connect to an advertising BLE device</li>
  <li>Get the UUIDs</li>
  <li>Execute Read and Write to handles</li>
  </ol>
  
  <p>The BlueZ community is strongly suggesting to use the GATT-Dbus api to accomplish this.  After multiple searches and head scratching I was not successful to find a proper way or example that would perform this through GATT-DBUs api.  It seems more complicate than just use directly the GATT layer.  Unfortunately BlueZ removed direct access to make calls to gatt.</p>
  
  <p>I'm very close to just pull the GATT source files out from Bluez, compile it as it's own independent library and directly use the GATT layer and calls to connect and execute reads/writes to ble device server.  I know it is not the suggested way compared to the DBUS-GATT api but I'm out of options.</p>
  
  <p>If anybody has any input on this or suggestion (with some sample code) please advise.</p>
  
  <p>thank you in advance!</p>