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

Unified Diff: device/bluetooth/bluez/bluetooth_remote_gatt_characteristic_bluez.h

Issue 2728623004: Fix getting notified twice after subscribe to notifications and call readValue (Closed)
Patch Set: address comments Created 3 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/bluez/bluetooth_remote_gatt_characteristic_bluez.h
diff --git a/device/bluetooth/bluez/bluetooth_remote_gatt_characteristic_bluez.h b/device/bluetooth/bluez/bluetooth_remote_gatt_characteristic_bluez.h
index 0687b0d2d31788a2877e4e74f1497ced97baffa3..c25c22fab5ce256904bb47084a8badaf2ba13e0b 100644
--- a/device/bluetooth/bluez/bluetooth_remote_gatt_characteristic_bluez.h
+++ b/device/bluetooth/bluez/bluetooth_remote_gatt_characteristic_bluez.h
@@ -63,6 +63,14 @@ class BluetoothRemoteGattCharacteristicBlueZ
const base::Closure& callback,
const ErrorCallback& error_callback) override;
+ bool characteristic_value_read_in_progress() {
+ return characteristic_value_read_in_progress_;
+ }
+
+ void set_characteristic_value_read_in_progress(bool in_progress) {
+ characteristic_value_read_in_progress_ = in_progress;
+ }
+
protected:
void SubscribeToNotifications(
device::BluetoothRemoteGattDescriptor* ccc_descriptor,
@@ -110,11 +118,17 @@ class BluetoothRemoteGattCharacteristicBlueZ
const std::string& error_name,
const std::string& error_message);
- // Called by dbus:: on unsuccessful completion of a request to read or write
+ // Called by dbus:: on unsuccessful completion of a request to read
// the characteristic value.
- void OnError(const ErrorCallback& error_callback,
- const std::string& error_name,
- const std::string& error_message);
+ void OnReadError(const ErrorCallback& error_callback,
+ const std::string& error_name,
+ const std::string& error_message);
+
+ // Called by dbus:: on unsuccessful completion of a request to write
+ // the characteristic value.
+ void OnWriteError(const ErrorCallback& error_callback,
+ const std::string& error_name,
+ const std::string& error_message);
// True, if there exists a Bluez notify session.
bool has_notify_session_;
@@ -133,6 +147,9 @@ class BluetoothRemoteGattCharacteristicBlueZ
// The GATT service this GATT characteristic belongs to.
BluetoothRemoteGattServiceBlueZ* service_;
+ // True if a gatt read request is in progress.
+ bool characteristic_value_read_in_progress_;
+
// Note: This should remain the last member so it'll be destroyed and
// invalidate its weak pointers before any other members are destroyed.
base::WeakPtrFactory<BluetoothRemoteGattCharacteristicBlueZ>

Powered by Google App Engine
This is Rietveld 408576698