语言

BluetoothGattConnectionSettings.Builder.SetRssiThresholdDbm(Int32) 方法

定义

设置用于启动连接的 RSSI 阈值。

[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

参数

rssiThresholdDbm
Int32

用于启动连接的 dBm 中的 RSSI 阈值。 值介于 -128 和 20 之间(含 20)

返回

此生成器。 此值不能为 null。

特性

注解

设置用于启动连接的 RSSI 阈值。 如果设备已连接,则无论 RSSI 如何,GATT 连接都将成功。

启用 autoConnect 时,RSSI 阈值用于启动与远程设备的 LE 连接。 启用 autoConnect 后,蓝牙控制器会将远程设备添加到接受列表,并在设备处于范围内且具有强信号时启动连接。 如果 RSSI 大于给定 RSSI 阈值,蓝牙控制器将启动连接。

这只是蓝牙控制器的首选项;控制器可能或不使用此阈值来启动连接。

当多个应用程序请求具有不同 RSSI 阈值的连接时,当基于信号强度启动下一个 LE 连接时,蓝牙系统将使用所有活动请求中的最低(最严格)RSSI 阈值,从而允许在任何应用请求时以较弱的信号级别启动连接。

将设置 RssiThresholdNotSet 默认 RSSI 阈值,指示未启用基于 RSSI 的 LE 连接触发器。

使用 SetPathlossThresholdDb(Int32) 路径阈值设置的优先级将优先于触发 LE 连接的 RSSI 阈值。 仅当未设置 pathloss 阈值时,RSSI 阈值才会用于触发 LE 连接。

Android 参考。android.bluetooth.BluetoothGattConnectionSettings.Builder.setRssiThresholdDbm

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于