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

# BluetoothGattConnectionSettings

*** ** * ** ***

```
class BluetoothGattConnectionSettings
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.bluetooth.BluetoothGattConnectionSettings](https://developer.android.com/reference/kotlin/android/bluetooth/BluetoothGattConnectionSettings#) |

Defines parameters for creating BluetoothGatt connection.

Used with android.bluetooth.BluetoothDevice#connectGatt to create a Gatt client connection.

android.bluetooth.BluetoothDevice#connectGatt ensures It applies the Gatt settings passed as part of `https://developer.android.com/reference/kotlin/android/bluetooth/BluetoothGattConnectionSettings#`

## Summary

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

| Constants ||
|---|---|
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/bluetooth/BluetoothGattConnectionSettings#PATHLOSS_THRESHOLD_NOT_SET:kotlin.Int` Value for not using pathloss threshold for triggering the connection. |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/bluetooth/BluetoothGattConnectionSettings#RSSI_THRESHOLD_NOT_SET:kotlin.Int` Value for not using RSSI threshold for triggering the connection. |

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

## Constants

### PATHLOSS_THRESHOLD_NOT_SET

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

```
static val PATHLOSS_THRESHOLD_NOT_SET: Int
```

Value for not using pathloss threshold for triggering the connection.

    Value: -1

### RSSI_THRESHOLD_NOT_SET

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

```
static val RSSI_THRESHOLD_NOT_SET: Int
```

Value for not using RSSI threshold for triggering the connection.

    Value: -128

## Public methods

### getPathlossThresholdDb

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

```
fun getPathlossThresholdDb(): Int
```

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

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | Value is between -1 and 100 inclusive |

**See Also**

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

### getRssiThresholdDbm

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

```
fun getRssiThresholdDbm(): Int
```

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

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | Value is between -128 and 20 inclusive |

**See Also**

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

### getTransport

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

```
fun getTransport(): Int
```

Returns the transport to be used for GATT connection.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | Value is one of the following: - `https://developer.android.com/reference/kotlin/android/bluetooth/BluetoothDevice#TRANSPORT_AUTO:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/bluetooth/BluetoothDevice#TRANSPORT_BREDR:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/bluetooth/BluetoothDevice#TRANSPORT_LE:kotlin.Int` |

### isAutoConnectEnabled

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

```
fun isAutoConnectEnabled(): Boolean
```

Returns true if auto connection enabled or false otherwise.

### isAutomaticMtuEnabled

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

```
fun isAutomaticMtuEnabled(): Boolean
```

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

### isOpportunisticEnabled

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

```
fun isOpportunisticEnabled(): Boolean
```

Returns if the GATT connection is opportunistic or not.

### toString

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

```
fun toString(): String
```

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

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | a string representation of the object. |