语言

BluetoothGattCallback.OnConnectionStateChange 方法

定义

指示 GATT 客户端何时与远程 GATT 服务器连接/断开连接的回调。

[Android.Runtime.Register("onConnectionStateChange", "(Landroid/bluetooth/BluetoothGatt;II)V", "GetOnConnectionStateChange_Landroid_bluetooth_BluetoothGatt_IIHandler")]
public virtual void OnConnectionStateChange(Android.Bluetooth.BluetoothGatt? gatt, Android.Bluetooth.GattStatus status, Android.Bluetooth.ProfileState newState);
[<Android.Runtime.Register("onConnectionStateChange", "(Landroid/bluetooth/BluetoothGatt;II)V", "GetOnConnectionStateChange_Landroid_bluetooth_BluetoothGatt_IIHandler")>]
abstract member OnConnectionStateChange : Android.Bluetooth.BluetoothGatt * Android.Bluetooth.GattStatus * Android.Bluetooth.ProfileState -> unit
override this.OnConnectionStateChange : Android.Bluetooth.BluetoothGatt * Android.Bluetooth.GattStatus * Android.Bluetooth.ProfileState -> unit

参数

gatt
BluetoothGatt

GATT 客户端

status
GattStatus

连接或断开连接操作的状态。 BluetoothGatt#GATT_SUCCESS 如果操作成功,则为

newState
ProfileState

返回新的连接状态。 可以是其中 BluetoothProfile#STATE_DISCONNECTED 一个或 BluetoothProfile#STATE_CONNECTED

特性

注解

指示 GATT 客户端何时与远程 GATT 服务器连接/断开连接的回调。

Java文档android.bluetooth.BluetoothGattCallback.onConnectionStateChange(android.bluetooth.BluetoothGatt, int, int)。

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

适用于