语言

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)。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于