語言

BluetoothGattServer.SetPreferredPhy 方法

定義

為這個應用程式設定首選的連線 PHY。

[Android.Runtime.Register("setPreferredPhy", "(Landroid/bluetooth/BluetoothDevice;III)V", "", ApiSince=26)]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public void SetPreferredPhy(Android.Bluetooth.BluetoothDevice? device, Android.Bluetooth.BluetoothPhy txPhy, Android.Bluetooth.BluetoothPhy rxPhy, Android.Bluetooth.BluetoothPhyOption phyOptions);
[<Android.Runtime.Register("setPreferredPhy", "(Landroid/bluetooth/BluetoothDevice;III)V", "", ApiSince=26)>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.SetPreferredPhy : Android.Bluetooth.BluetoothDevice * Android.Bluetooth.BluetoothPhy * Android.Bluetooth.BluetoothPhy * Android.Bluetooth.BluetoothPhyOption -> unit

參數

device
BluetoothDevice

傳送此回應的遠端裝置。

txPhy
BluetoothPhy

偏好發射機 PHY。

rxPhy
BluetoothPhy

偏好的接球員PHY。

phyOptions
BluetoothPhyOption

在LE編碼PHY傳輸時偏好使用的編碼方式。 可以是其中 BluetoothDevice#PHY_OPTION_NO_PREFERRED之一, BluetoothDevice#PHY_OPTION_S2 或 BluetoothDevice#PHY_OPTION_S8。

屬性

備註

為這個應用程式設定首選的連線 PHY。 請注意,這只是建議,PHY 是否會改變取決於其他應用程式的偏好、本地和遠端控制器的功能。 控制器可以覆寫這些設定。

BluetoothGattServerCallback#onPhyUpdate 即使 PHY 沒有變動,也會因此呼叫而被觸發。 當遠端裝置更新 PHY 時,也會觸發。

Java 文件 android.bluetooth.BluetoothGattServer.setPreferredPhy(android.bluetooth.BluetoothDevice, int, int, int)。

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

適用於