BluetoothGattConnectionSettings


public final class BluetoothGattConnectionSettings
extends Object

java.lang.Object
   ↳ android.bluetooth.BluetoothGattConnectionSettings


Defines parameters for creating BluetoothGatt connection.

Used with BluetoothDevice.connectGatt to create a Gatt client connection.

BluetoothDevice.connectGatt ensures It applies the Gatt settings passed as part of BluetoothGattConnectionSettings

Summary

Nested classes

class BluetoothGattConnectionSettings.Builder

Builder for BluetoothGattConnectionSettings

Constants

int PATHLOSS_THRESHOLD_NOT_SET

Value for not using pathloss threshold for triggering the connection.

int RSSI_THRESHOLD_NOT_SET

Value for not using RSSI threshold for triggering the connection.

Public methods

int getPathlossThresholdDb()

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

int getRssiThresholdDbm()

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

int getTransport()

Returns the transport to be used for GATT connection.

boolean isAutoConnectEnabled()

Returns true if auto connection enabled or false otherwise.

boolean isAutomaticMtuEnabled()

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

boolean isOpportunisticEnabled()

Returns if the GATT connection is opportunistic or not.

String toString()

Returns a String that describes each BluetoothGattConnectionSettings parameter current value.

Inherited methods

Constants

PATHLOSS_THRESHOLD_NOT_SET

Added in API level 10000
public static final int PATHLOSS_THRESHOLD_NOT_SET

Value for not using pathloss threshold for triggering the connection.

Constant Value: -1 (0xffffffff)

RSSI_THRESHOLD_NOT_SET

Added in API level 10000
public static final int RSSI_THRESHOLD_NOT_SET

Value for not using RSSI threshold for triggering the connection.

Constant Value: -128 (0xffffff80)

Public methods

getPathlossThresholdDb

Added in API level 10000
public int getPathlossThresholdDb ()

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

Returns
int Value is between -1 and 100 inclusive

getRssiThresholdDbm

Added in API level 10000
public int getRssiThresholdDbm ()

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

Returns
int Value is between -128 and 20 inclusive

getTransport

Added in API level 37
public int getTransport ()

Returns the transport to be used for GATT connection.

Returns
int Value is one of the following:

isAutoConnectEnabled

Added in API level 37
public boolean isAutoConnectEnabled ()

Returns true if auto connection enabled or false otherwise.

Returns
boolean

isAutomaticMtuEnabled

Added in API level 37
public boolean isAutomaticMtuEnabled ()

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

Returns
boolean

isOpportunisticEnabled

Added in API level 37
public boolean isOpportunisticEnabled ()

Returns if the GATT connection is opportunistic or not.

Returns
boolean

toString

Added in API level 37
public String toString ()

Returns a String that describes each BluetoothGattConnectionSettings parameter current value.

Returns
String a string representation of the object.