Udostępnij za pośrednictwem


BluetoothManager.GetConnectionState(BluetoothDevice, ProfileType) Method

Definition

Get the current connection state of the profile to the remote device.

[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

Parameters

device
BluetoothDevice

Remote bluetooth device.

profile
ProfileType

GATT or GATT_SERVER

Returns

State of the profile connection. One of BluetoothProfile#STATE_CONNECTED, BluetoothProfile#STATE_CONNECTING, BluetoothProfile#STATE_DISCONNECTED, BluetoothProfile#STATE_DISCONNECTING

Attributes

Remarks

Get the current connection state of the profile to the remote device.

This is not specific to any application configuration but represents the connection state of the local Bluetooth adapter for certain profile. This can be used by applications like status bar which would just like to know the state of Bluetooth.

Java documentation for android.bluetooth.BluetoothManager.getConnectionState(android.bluetooth.BluetoothDevice, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to