語言

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

RSSI 以 dBm 為單位的連接啟動閾值。 價值介於 -128 到20之間,包含

傳回

這個建築商。 這個值不可能為零值。

屬性

備註

設定 RSSI 閾值以啟動連線。 如果裝置已經連接,那麼無論 RSSI 如何,GATT 連線都會成功。

RSSI 閾值用於在啟用 autoConnect 時,啟動與遠端裝置的 LE 連線。 啟用 autoConnect 後,藍牙控制器會將遠端裝置加入接受清單,並在裝置在範圍內且訊號強時啟動連線。 當 RSSI 超過給定的 RSSI 閾值時,藍牙控制器會啟動連線。

這只是我對藍牙控制器的偏好;控制器可能會使用或不會使用此閾值來啟動連線。

當多個應用程式請求不同 RSSI 閾值的連線時,藍牙系統會在所有主動請求中,根據訊號強度使用所有主動請求中最低(最不嚴格)的 RSSI 閾值,若有應用程式請求,則可在較弱訊號強度下啟動連線。

預設的 RSSI 閾值會設為 BluetoothGattConnectionSettings.RSSI_THRESHOLD_NOT_SET,表示基於 RSSI 的 LE 連線觸發器尚未啟用。

使用 setPathlossThresholdDb(int) 設定的路徑損失閾值,將優先於 RSSI 閾值以觸發 LE 連線。 只有在未設定路徑損失閾值時,RSSI 閾值才用於觸發 LE 連線。

Android 參考資料。android.bluetooth.BluetoothGattConnectionSettings.Builder.setRssiThresholdDbm

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於