BluetoothGattConnectionSettings.Builder.SetPathlossThresholdDb(Int32) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
设置用于启动连接的 Pathloss 阈值。
[Android.Runtime.Register("setPathlossThresholdDb", "(I)Landroid/bluetooth/BluetoothGattConnectionSettings$Builder;", "", ApiSince=37)]
public Android.Bluetooth.BluetoothGattConnectionSettings.Builder SetPathlossThresholdDb(int pathlossThresholdDb);
[<Android.Runtime.Register("setPathlossThresholdDb", "(I)Landroid/bluetooth/BluetoothGattConnectionSettings$Builder;", "", ApiSince=37)>]
member this.SetPathlossThresholdDb : int -> Android.Bluetooth.BluetoothGattConnectionSettings.Builder
参数
- pathlossThresholdDb
- Int32
用于启动连接的 dB 中的 pathloss 阈值。 值介于 -1 和 100 之间(含 100 个)
返回
此生成器。 此值不能为 null。
- 特性
注解
设置用于启动连接的 Pathloss 阈值。 如果设备已连接,则无论 Pathloss 阈值如何,GATT 连接都将成功。
启用 autoConnect 时,Pathloss 阈值用于启动与远程设备的 LE 连接。 启用 autoConnect 后,蓝牙控制器会将远程设备添加到接受列表,并在设备处于范围内且路径最少时启动连接。 如果 Pathloss 低于给定 Pathloss 阈值,蓝牙控制器将启动连接。
这只是蓝牙控制器的首选项;控制器可能或不使用此 pathloss 阈值来启动连接。
当多个应用程序请求具有不同 pathloss 阈值的连接时,当基于 pathloss 阈值启动下一个 LE 连接时,蓝牙系统将使用所有活动请求之间的路径阈值上限。
默认 pathloss 阈值将设置为BluetoothGattConnectionSettings.PATHLOSS_THRESHOLD_NOT_SET,指示未启用基于 pathloss 的 LE 连接触发器。
当 Pathloss 不可用或此值BluetoothGattConnectionSettings.PATHLOSS_THRESHOLD_NOT_SET时,如果使用 setRssiThresholdDbm(int) 设置 RSSI 阈值,系统将回退到基于 RSSI 阈值的连接触发器
Android 参考。android.bluetooth.BluetoothGattConnectionSettings.Builder.setPathlossThresholdDb
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。