语言

ScanSettings.Builder.SetPhy(BluetoothPhy) 方法

定义

设置此扫描期间要使用的物理层。

[Android.Runtime.Register("setPhy", "(I)Landroid/bluetooth/le/ScanSettings$Builder;", "", ApiSince=26)]
public Android.Bluetooth.LE.ScanSettings.Builder? SetPhy(Android.Bluetooth.BluetoothPhy phy);
[<Android.Runtime.Register("setPhy", "(I)Landroid/bluetooth/le/ScanSettings$Builder;", "", ApiSince=26)>]
member this.SetPhy : Android.Bluetooth.BluetoothPhy -> Android.Bluetooth.LE.ScanSettings.Builder

参数

phy
BluetoothPhy

可以是BluetoothDevice.PHY_LE_1M、BluetoothDevice.PHY_LE_CODED或ScanSettings.PHY_LE_ALL_SUPPORTED之一

返回

特性

注解

设置此扫描期间要使用的物理层。 仅当 ScanSettings.Builder.setLegacy 设置为 false 时,才使用此方法。 BluetoothAdapter.isLeCodedPhySupported() 可用于检查是否通过调用 BluetoothAdapter.isLeCodedPhySupported() 来检查 LE Coded phy 是否受支持。 选择不支持的 phy 将导致无法启动扫描。

Android 参考。android.bluetooth.le.ScanSettings.Builder.setPhy

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

适用于