语言

BluetoothGattServerCallback.OnConnectionStateChange 方法

定义

指示远程设备何时连接或断开连接的回调。

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

参数

device
BluetoothDevice

已连接或断开连接的远程设备。

status
ProfileState

连接或断开连接操作的状态。

newState
ProfileState

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

特性

注解

指示远程设备何时连接或断开连接的回调。

Java文档android.bluetooth.BluetoothGattServerCallback.onConnectionStateChange(android.bluetooth.BluetoothDevice, int, int)。

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

适用于