Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: device/bluetooth/bluetooth_remote_gatt_descriptor_android.h

Issue 1712593002: bluetooth: android: Confirm the notify session after the descriptor has been written. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Vincent's comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/bluetooth_remote_gatt_descriptor_android.h
diff --git a/device/bluetooth/bluetooth_remote_gatt_descriptor_android.h b/device/bluetooth/bluetooth_remote_gatt_descriptor_android.h
index bc50d65a1fc717cee4c90035b3e68cdde4798f3c..2b0fa58ed414933d24d57821024000dac6711804 100644
--- a/device/bluetooth/bluetooth_remote_gatt_descriptor_android.h
+++ b/device/bluetooth/bluetooth_remote_gatt_descriptor_android.h
@@ -50,6 +50,17 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothRemoteGattDescriptorAndroid
const base::Closure& callback,
const ErrorCallback& error_callback) override;
+ // Called when Read operation completes.
+ void OnRead(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& jcaller,
+ int32_t status,
+ const base::android::JavaParamRef<jbyteArray>& value);
+
+ // Called when Write operation completes.
+ void OnWrite(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& jcaller,
+ int32_t status);
+
private:
BluetoothRemoteGattDescriptorAndroid(const std::string& instanceId);
@@ -60,6 +71,18 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothRemoteGattDescriptorAndroid
// Adapter unique instance ID.
std::string instance_id_;
+ // ReadRemoteCharacteristic callbacks and pending state.
+ bool read_pending_ = false;
+ ValueCallback read_callback_;
+ ErrorCallback read_error_callback_;
+
+ // WriteRemoteCharacteristic callbacks and pending state.
+ bool write_pending_ = false;
+ base::Closure write_callback_;
+ ErrorCallback write_error_callback_;
+
+ std::vector<uint8_t> value_;
+
DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattDescriptorAndroid);
};

Powered by Google App Engine
This is Rietveld 408576698