語言

BluetoothGattCallback.OnCharacteristicWrite 方法

定義

回調表示特徵寫入操作的結果。

[Android.Runtime.Register("onCharacteristicWrite", "(Landroid/bluetooth/BluetoothGatt;Landroid/bluetooth/BluetoothGattCharacteristic;I)V", "GetOnCharacteristicWrite_Landroid_bluetooth_BluetoothGatt_Landroid_bluetooth_BluetoothGattCharacteristic_IHandler")]
public virtual void OnCharacteristicWrite(Android.Bluetooth.BluetoothGatt? gatt, Android.Bluetooth.BluetoothGattCharacteristic? characteristic, Android.Bluetooth.GattStatus status);
[<Android.Runtime.Register("onCharacteristicWrite", "(Landroid/bluetooth/BluetoothGatt;Landroid/bluetooth/BluetoothGattCharacteristic;I)V", "GetOnCharacteristicWrite_Landroid_bluetooth_BluetoothGatt_Landroid_bluetooth_BluetoothGattCharacteristic_IHandler")>]
abstract member OnCharacteristicWrite : Android.Bluetooth.BluetoothGatt * Android.Bluetooth.BluetoothGattCharacteristic * Android.Bluetooth.GattStatus -> unit
override this.OnCharacteristicWrite : Android.Bluetooth.BluetoothGatt * Android.Bluetooth.BluetoothGattCharacteristic * Android.Bluetooth.GattStatus -> unit

參數

gatt
BluetoothGatt

GATT 客戶端呼叫 BluetoothGatt#writeCharacteristic(BluetoothGattCharacteristic, byte[], int)

characteristic
BluetoothGattCharacteristic

寫入到相關遠端裝置的特徵。

status
GattStatus

如果操作成功,則是寫入操作 BluetoothGatt#GATT_SUCCESS 的結果。

屬性

備註

回調表示特徵寫入操作的結果。

若在可靠寫入交易進行時呼叫此特徵值代表遠端裝置回報的值。 應用程式應將此值與期望撰寫的值進行比較。 若值不匹配,應用程式必須中止可靠的寫入交易。

Java 文件 android.bluetooth.BluetoothGattCallback.onCharacteristicWrite(android.bluetooth.BluetoothGatt, android.bluetooth.BluetoothGattCharacteristic, int)。

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

適用於