語言

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)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於