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
See also:
Summary
Nested classes | |
|---|---|
class |
BluetoothGattConnectionSettings.Builder
Builder for |
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 |
Inherited methods | |
|---|---|
Constants
PATHLOSS_THRESHOLD_NOT_SET
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
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
public int getPathlossThresholdDb ()
Returns the Pathloss threshold (upper bound) in dB for initiating connection.
| Returns | |
|---|---|
int |
Value is between -1 and 100 inclusive |
getRssiThresholdDbm
public int getRssiThresholdDbm ()
Returns the RSSI threshold (lower bound) in dBm for initiating connection.
| Returns | |
|---|---|
int |
Value is between -128 and 20 inclusive |
getTransport
public int getTransport ()
Returns the transport to be used for GATT connection.
| Returns | |
|---|---|
int |
Value is one of the following: |
isAutoConnectEnabled
public boolean isAutoConnectEnabled ()
Returns true if auto connection enabled or false otherwise.
| Returns | |
|---|---|
boolean |
|
isAutomaticMtuEnabled
public boolean isAutomaticMtuEnabled ()
Returns true if the automatic MTU exchange is enabled for this connection or false otherwise.
| Returns | |
|---|---|
boolean |
|
isOpportunisticEnabled
public boolean isOpportunisticEnabled ()
Returns if the GATT connection is opportunistic or not.
| Returns | |
|---|---|
boolean |
|
toString
public String toString ()
Returns a String that describes each BluetoothGattConnectionSettings parameter
current value.
| Returns | |
|---|---|
String |
a string representation of the object. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-08-14 UTC.