Sprache

BluetoothManager.GetConnectionState(BluetoothDevice, ProfileType) Methode

Definition

Rufen Sie den aktuellen Verbindungsstatus des Profils mit dem Remotegerät ab.

[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

Parameter

device
BluetoothDevice

Bluetooth-Remotegerät.

profile
ProfileType

GATT oder GATT_SERVER

Gibt zurück

Status der Profilverbindung. Einer von BluetoothProfile#STATE_CONNECTED, , BluetoothProfile#STATE_CONNECTING, BluetoothProfile#STATE_DISCONNECTEDBluetoothProfile#STATE_DISCONNECTING

Attribute

Hinweise

Rufen Sie den aktuellen Verbindungsstatus des Profils mit dem Remotegerät ab.

Dies ist nicht spezifisch für jede Anwendungskonfiguration, sondern stellt den Verbindungsstatus des lokalen Bluetooth-Adapters für bestimmte Profile dar. Dies kann von Anwendungen wie der Statusleiste verwendet werden, die nur den Status von Bluetooth kennen möchten.

Java Dokumentation für android.bluetooth.BluetoothManager.getConnectionState(android.bluetooth.BluetoothDevice, int).

Teile dieser Seite sind Änderungen auf der Grundlage von Arbeiten, die von der Android Open Source Project erstellt und gemeinsam verwendet und gemäß den in der 2.5 Attribution License beschriebenen Begriffen verwendet werden.

Gilt für: