BluetoothGattCallback.OnConnectionStateChange 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
指示 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 服务器连接/断开连接的回调。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。