Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings#nestedclasses) \| [Constants](https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings#constants) \| [Methods](https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings#inhmethods)

# BluetoothGattConnectionSettings

*** ** * ** ***


`
public

final

class
BluetoothGattConnectionSettings
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.bluetooth.BluetoothGattConnectionSettings |

<br />

*** ** * ** ***

Defines parameters for creating BluetoothGatt connection.

Used with `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#connectGatt(android.bluetooth.BluetoothGattConnectionSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothGattCallback)` to create a Gatt client connection.

`https://developer.android.com/reference/android/bluetooth/BluetoothDevice#connectGatt(android.bluetooth.BluetoothGattConnectionSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothGattCallback)` ensures It applies the Gatt settings passed as part of
`https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings`
**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#connectGatt(android.bluetooth.BluetoothGattConnectionSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothGattCallback)`

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings.Builder` Builder for `https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings`. |

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings#PATHLOSS_THRESHOLD_NOT_SET` Value for not using pathloss threshold for triggering the connection. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings#RSSI_THRESHOLD_NOT_SET` Value for not using RSSI threshold for triggering the connection. |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings#getPathlossThresholdDb()() ` Returns the Pathloss threshold (upper bound) in dB for initiating connection. |
| ` int` | ` https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings#getRssiThresholdDbm()() ` Returns the RSSI threshold (lower bound) in dBm for initiating connection. |
| ` int` | ` https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings#getTransport()() ` Returns the transport to be used for GATT connection. |
| ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings#isAutoConnectEnabled()() ` Returns true if auto connection enabled or false otherwise. |
| ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings#isAutomaticMtuEnabled()() ` Returns true if the automatic MTU exchange is enabled for this connection or false otherwise. |
| ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings#isOpportunisticEnabled()() ` Returns if the GATT connection is opportunistic or not. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings#toString()() ` Returns a `https://developer.android.com/reference/java/lang/String` that describes each BluetoothGattConnectionSettings parameter current value. |

### Inherited methods

From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

Indicates whether some other object is "equal to" this one.


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

Wakes up a single thread that is waiting on this object's
monitor.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

Wakes up all threads that are waiting on this object's monitor.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*.


## Constants

### PATHLOSS_THRESHOLD_NOT_SET

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final int PATHLOSS_THRESHOLD_NOT_SET
```

Value for not using pathloss threshold for triggering the connection.

<br />

Constant Value:

-1
(0xffffffff)


### RSSI_THRESHOLD_NOT_SET

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final int RSSI_THRESHOLD_NOT_SET
```

Value for not using RSSI threshold for triggering the connection.

<br />

Constant Value:

-128
(0xffffff80)


## Public methods

### getPathlossThresholdDb

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public int getPathlossThresholdDb ()
```

Returns the Pathloss threshold (upper bound) in dB for initiating connection.

<br />

| Returns ||
|---|---|
| `int` | Value is between -1 and 100 inclusive <br /> |

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings.Builder#setPathlossThresholdDb(int)`

  `https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings.Builder#setPathlossThresholdDb(int)`

### getRssiThresholdDbm

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public int getRssiThresholdDbm ()
```

Returns the RSSI threshold (lower bound) in dBm for initiating connection.

<br />

| Returns ||
|---|---|
| `int` | Value is between -128 and 20 inclusive <br /> |

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings.Builder#setRssiThresholdDbm(int)`

  `https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings.Builder#setRssiThresholdDbm(int)`

### getTransport

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getTransport ()
```

Returns the transport to be used for GATT connection.

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_AUTO` - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_BREDR` - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_LE` |

### isAutoConnectEnabled

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isAutoConnectEnabled ()
```

Returns true if auto connection enabled or false otherwise.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### isAutomaticMtuEnabled

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isAutomaticMtuEnabled ()
```

Returns true if the automatic MTU exchange is enabled for this connection or false otherwise.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### isOpportunisticEnabled

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isOpportunisticEnabled ()
```

Returns if the GATT connection is opportunistic or not.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### toString

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a `https://developer.android.com/reference/java/lang/String` that describes each BluetoothGattConnectionSettings parameter
current value.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |