Added in API level 37

BluetoothGattConnectionSettings


class BluetoothGattConnectionSettings
kotlin.Any
   ↳ 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 BluetoothGattConnectionSettings

Summary

Nested classes

Builder for BluetoothGattConnectionSettings.

Constants
static Int

Value for not using pathloss threshold for triggering the connection.

static Int

Value for not using RSSI threshold for triggering the connection.

Public methods
Int

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

Int

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

Int

Returns the transport to be used for GATT connection.

Boolean

Returns true if auto connection enabled or false otherwise.

Boolean

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

Boolean

Returns if the GATT connection is opportunistic or not.

String

Returns a String that describes each BluetoothGattConnectionSettings parameter current value.

Constants

PATHLOSS_THRESHOLD_NOT_SET

static val PATHLOSS_THRESHOLD_NOT_SET: Int

Value for not using pathloss threshold for triggering the connection.

Value: -1

RSSI_THRESHOLD_NOT_SET

static val RSSI_THRESHOLD_NOT_SET: Int

Value for not using RSSI threshold for triggering the connection.

Value: -128

Public methods

getPathlossThresholdDb

fun getPathlossThresholdDb(): Int

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

Return
Int Value is between -1 and 100 inclusive

getRssiThresholdDbm

fun getRssiThresholdDbm(): Int

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

Return
Int Value is between -128 and 20 inclusive

getTransport

Added in API level 37
fun getTransport(): Int

Returns the transport to be used for GATT connection.

Return
Int Value is one of the following:

isAutoConnectEnabled

Added in API level 37
fun isAutoConnectEnabled(): Boolean

Returns true if auto connection enabled or false otherwise.

isAutomaticMtuEnabled

Added in API level 37
fun isAutomaticMtuEnabled(): Boolean

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

isOpportunisticEnabled

Added in API level 37
fun isOpportunisticEnabled(): Boolean

Returns if the GATT connection is opportunistic or not.

toString

Added in API level 37
fun toString(): String

Returns a String that describes each BluetoothGattConnectionSettings parameter current value.

Return
String a string representation of the object.