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

Unified Diff: device/bluetooth/bluetooth_gatt_service.h

Issue 264053004: device/bluetooth: Improvements to GATT descriptor access API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pull & rebase. Created 6 years, 7 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_gatt_service.h
diff --git a/device/bluetooth/bluetooth_gatt_service.h b/device/bluetooth/bluetooth_gatt_service.h
index 346772e587d43ddf948dc3b693386211e736737d..16f4ae5f9e15b192ab553ecbe2ee8efac27f65b2 100644
--- a/device/bluetooth/bluetooth_gatt_service.h
+++ b/device/bluetooth/bluetooth_gatt_service.h
@@ -173,6 +173,28 @@ class BluetoothGattService {
BluetoothGattService* service,
BluetoothGattCharacteristic* characteristic) {}
+ // Called when the remote GATT characteristic descriptor |descriptor|
+ // belonging to characteristic |characteristic| has been discovered. Don't
+ // cache the arguments as the pointers may become invalid. Instead, use the
+ // specially assigned identifier to obtain a descriptor and cache that
+ // identifier as necessary.
+ //
+ // This method will always be followed by a call to GattServiceChanged,
+ // which can be used by observers to get all the characteristics of a
+ // service and perform the necessary updates. GattDescriptorAdded exists
+ // mostly for convenience.
+ virtual void GattDescriptorAdded(
+ BluetoothGattCharacteristic* characteristic,
+ BluetoothGattDescriptor* descriptor) {}
+
+ // Called when a GATT characteristic descriptor |descriptor| belonging to
+ // characteristic |characteristic| has been removed. This method is for
+ // convenience and will be followed by a call to GattServiceChanged (except
+ // when called after the service gets removed).
+ virtual void GattDescriptorRemoved(
+ BluetoothGattCharacteristic* characteristic,
+ BluetoothGattDescriptor* descriptor) {}
+
// Called when the value of a characteristic has changed. This might be a
// result of a read/write request to, or a notification/indication from, a
// remote GATT characteristic.
@@ -180,6 +202,12 @@ class BluetoothGattService {
BluetoothGattService* service,
BluetoothGattCharacteristic* characteristic,
const std::vector<uint8>& value) {}
+
+ // Called when the value of a characteristic descriptor has been updated.
+ virtual void GattDescriptorValueChanged(
+ BluetoothGattCharacteristic* characteristic,
+ BluetoothGattDescriptor* descriptor,
+ const std::vector<uint8>& value) {}
};
// The ErrorCallback is used by methods to asynchronously report errors.
« no previous file with comments | « device/bluetooth/bluetooth_gatt_chromeos_unittest.cc ('k') | device/bluetooth/bluetooth_remote_gatt_characteristic_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698