Language

BluetoothGattConnectionSettings.Builder.SetRssiThresholdDbm(Int32) Method

Definition

Sets the RSSI threshold for initiating a connection.

[Android.Runtime.Register("setRssiThresholdDbm", "(I)Landroid/bluetooth/BluetoothGattConnectionSettings$Builder;", "", ApiSince=37)]
public Android.Bluetooth.BluetoothGattConnectionSettings.Builder SetRssiThresholdDbm(int rssiThresholdDbm);
[<Android.Runtime.Register("setRssiThresholdDbm", "(I)Landroid/bluetooth/BluetoothGattConnectionSettings$Builder;", "", ApiSince=37)>]
member this.SetRssiThresholdDbm : int -> Android.Bluetooth.BluetoothGattConnectionSettings.Builder

Parameters

rssiThresholdDbm
Int32

the RSSI threshold in dBm for initiating connection. Value is between -128 and 20 inclusive

Returns

This builder. This value cannot be null.

Attributes

Remarks

Sets the RSSI threshold for initiating a connection. If the device is already connected, then the GATT connection will succeed regardless of the RSSI.

The RSSI threshold is used to initiate an LE connection to a remote device when autoConnect is enabled. When autoConnect is enabled, the Bluetooth controller will add the remote device to the accept list and initiate the connection when the device is in range and has a strong signal. The Bluetooth controller will initiate the connection if the RSSI is greater than the given RSSI threshold value.

This is just a preference for the Bluetooth controller; the controller may or may not use this threshold to initiate the connection.

When multiple applications request connections with different RSSI threshold values, the Bluetooth system will use the lowest (least stringent) RSSI threshold among all active requests when initiating the next LE connection based on signal strength, allowing connections to be initiated at weaker signal levels if any app requests it.

Default RSSI threshold will be set to BluetoothGattConnectionSettings.RSSI_THRESHOLD_NOT_SET which indicates that RSSI based LE connection trigger is not enabled.

Pathloss threshold set using setPathlossThresholdDb(int) will be prioritized over RSSI threshold for triggering LE connection. RSSI threshold will be used for triggering LE connection only if pathloss threshold is not set.

Android reference for android.bluetooth.BluetoothGattConnectionSettings.Builder.setRssiThresholdDbm.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to