title: How to get Disconnect Event from GATT Server on Bluez/Linux
body: <p>Environment: Bluez 5.14, Linux 3.1, USB Plugable BLE radio, TI BLE keyfob (CC2541 dev kit)
    Linux Device &lt;---hci----> USB BLE Radio </p>
  
  <p>We enabled key press events on TI keyfob using gatttool and started to listen for events</p>
  
  <pre><code>gatttool -b [hardware ID] --char-write-req -a [handle] -n [value] --listen 
  (gatttool -b 90:59:AF:09:E1:5D --char-write-req -a 0x0048 -n 0100 --listen)
  </code></pre>
  
  <p>Pressing buttons on the keyfob and see these events</p>
  
  <pre><code>Notification handle = 0x0047 value: 02 
  Notification handle = 0x0047 value: 00 
  Notification handle = 0x0047 value: 02
  </code></pre>
  
  <p>Hence we can receive the key press events from the Keyfob through the Bluez stack</p>
  
  <p>Objective: </p>
  
  <p>We need to catch the GATT Disconnect Event i.e. When we remove the battery from the keyfob sooner or later the GATT connection is broken. We would like to receive a disconnect event from Bluez stack. Bluez has this capability since Android supports GATT disconnect event which is built over Bluez.</p>
  
  <p>Question: </p>
  
  <p>How do we receive the GATT Disconnect event using Bluez command line hcitool/gatttool or Bluez API.</p>