语言

BluetoothManager.GetConnectionState(BluetoothDevice, ProfileType) 方法

定义

获取配置文件到远程设备的当前连接状态。

[Android.Runtime.Register("getConnectionState", "(Landroid/bluetooth/BluetoothDevice;I)I", "")]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public Android.Bluetooth.ProfileState GetConnectionState(Android.Bluetooth.BluetoothDevice? device, Android.Bluetooth.ProfileType profile);
[<Android.Runtime.Register("getConnectionState", "(Landroid/bluetooth/BluetoothDevice;I)I", "")>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.GetConnectionState : Android.Bluetooth.BluetoothDevice * Android.Bluetooth.ProfileType -> Android.Bluetooth.ProfileState

参数

device
BluetoothDevice

远程蓝牙设备。

profile
ProfileType

GATT 或 GATT_SERVER

返回

配置文件连接的状态。 其中一个BluetoothProfile#STATE_CONNECTED,BluetoothProfile#STATE_CONNECTING,, BluetoothProfile#STATE_DISCONNECTEDBluetoothProfile#STATE_DISCONNECTING

属性

注解

获取配置文件到远程设备的当前连接状态。

这并非特定于任何应用程序配置,而是表示特定配置文件的本地蓝牙适配器的连接状态。 这可以由状态栏等应用程序使用,它们只想了解蓝牙的状态。

Java文档android.bluetooth.BluetoothManager.getConnectionState(android.bluetooth.BluetoothDevice, int)。

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

适用于