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 |
|
| 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 |
toString()Returns a |
Constants
PATHLOSS_THRESHOLD_NOT_SET
static val PATHLOSS_THRESHOLD_NOT_SET: Int
Value for not using pathloss threshold for triggering the connection.
Value: -1RSSI_THRESHOLD_NOT_SET
static val RSSI_THRESHOLD_NOT_SET: Int
Value for not using RSSI threshold for triggering the connection.
Value: -128Public 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
fun getTransport(): Int
Returns the transport to be used for GATT connection.
| Return | |
|---|---|
Int |
Value is one of the following: |
isAutoConnectEnabled
fun isAutoConnectEnabled(): Boolean
Returns true if auto connection enabled or false otherwise.
isAutomaticMtuEnabled
fun isAutomaticMtuEnabled(): Boolean
Returns true if the automatic MTU exchange is enabled for this connection or false otherwise.
isOpportunisticEnabled
fun isOpportunisticEnabled(): Boolean
Returns if the GATT connection is opportunistic or not.
toString
fun toString(): String
Returns a String that describes each BluetoothGattConnectionSettings parameter current value.
| Return | |
|---|---|
String |
a string representation of the object. |