code: protected BluetoothGatt connect(@NonNull final String address) {
  		if (!mBluetoothAdapter.isEnabled())
  			return null;
  
  		mConnectionState = STATE_CONNECTING;
  
  		logi("Connecting to the device...");
  		final BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);
  		sendLogBroadcast(LOG_LEVEL_DEBUG, "gatt = device.connectGatt(autoConnect = false)");
  		final BluetoothGatt gatt = device.connectGatt(this, false, mGattCallback);
  
  		// We have to wait until the device is connected and services are discovered
  		// Connection error may occur as well.
  		try {
  			synchronized (mLock) {
  				while ((mConnectionState == STATE_CONNECTING || mConnectionState == STATE_CONNECTED) && mError == 0)
  					mLock.wait();
  			}
  		} catch (final InterruptedException e) {
  			loge("Sleeping interrupted", e);
  		}
  		return gatt;
  	}
docs: Connects to the BLE device with given address. This method is SYNCHRONOUS, it wait until
  the connection status change from {@link #STATE_CONNECTING} to
  {@link #STATE_CONNECTED_AND_READY} or an error occurs.
  This method returns <code>null</code> if Bluetooth adapter is disabled.
  
  @param address the device address.
  @return The GATT device or <code>null</code> if Bluetooth adapter is disabled.