title: Android BLE Gatt connection change statuses
body: <p>I have an android app to connect to a BLE device and write to it. I can successfully connect, read and write to it. As a part of testing, we are trying different disconnection scenarios.</p>
  <p>Sometimes, if BLE device disconnects the connection, I get the connection change as disconnect with status value as 19. Also if there is any bond error, status equals 22. If I programmatically disconnect the connection, this status gives me 0. But none of these states except 0 are specified in <a href="https://developer.android.com/reference/android/bluetooth/BluetoothGatt.html" rel="nofollow noreferrer">android documentation</a>.</p>
  <p>Posting a sample BluetoothGattCallback</p>
  <pre><code>private BluetoothGattCallback bluetoothGattCallback = new BluetoothGattCallback() {
      @Override
      public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {
          Log.i(TAG, &quot;onConnectionStateChange status: &quot;+status+&quot;, newState: &quot;+newState);
          /*i need to know the possible values for this status variable*/
          if(newState == BluetoothProfile.STATE_CONNECTED) {
              gatt.discoverServices();
          } else {
              gatt.close();
          }
      }
  
      @Override
      public void onServicesDiscovered(BluetoothGatt gatt, int status) {
          Log.i(TAG, &quot;onServicesDiscovered service discovered&quot;);
      }
  };
  </code></pre>
  <p><strong>Does anyone face this same problem and sorted out the list of statuses. I need to know the possible values for status variable in onConnectionStateChange method</strong></p>