语言

BluetoothAdapter.GetProfileConnectionState(ProfileType) 方法

定义

获取配置文件的当前连接状态。

[Android.Runtime.Register("getProfileConnectionState", "(I)I", "")]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public Android.Bluetooth.ProfileState GetProfileConnectionState(Android.Bluetooth.ProfileType profile);
[<Android.Runtime.Register("getProfileConnectionState", "(I)I", "")>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.GetProfileConnectionState : Android.Bluetooth.ProfileType -> Android.Bluetooth.ProfileState

参数

profile
ProfileType

返回

值为下列值之一:STATE_DISCONNECTED;STATE_CONNECTING;STATE_CONNECTED;STATE_DISCONNECTING

特性

注解

获取配置文件的当前连接状态。 此函数可用于检查本地蓝牙适配器是否连接到特定配置文件的任何远程设备。 配置文件可以是其中BluetoothProfile#HEADSETBluetoothProfile#A2DP一个。

返回配置文件连接状态

Android 参考。android.bluetooth.BluetoothAdapter.getProfileConnectionState

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

适用于