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

Unified Diff: device/bluetooth/bluetooth_gatt_characteristic.h

Issue 134263008: device/bluetooth: Add abstract API definition for BluetoothGattDescriptor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « device/bluetooth/bluetooth.gyp ('k') | device/bluetooth/bluetooth_gatt_descriptor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_gatt_characteristic.h
diff --git a/device/bluetooth/bluetooth_gatt_characteristic.h b/device/bluetooth/bluetooth_gatt_characteristic.h
index 87993ac38828d707af5ae941f2ae0402e74ee5b2..00f7a882e4e24f02c03e1f479b9516857c349ab2 100644
--- a/device/bluetooth/bluetooth_gatt_characteristic.h
+++ b/device/bluetooth/bluetooth_gatt_characteristic.h
@@ -95,7 +95,11 @@ class BluetoothGattCharacteristic {
};
// The ErrorCallback is used by methods to asynchronously report errors.
- typedef base::Callback<const std::string&> ErrorCallback;
+ typedef base::Callback<void(const std::string&)> ErrorCallback;
+
+ // The ValueCallback is used to return the value of a remote characteristic
+ // upon a read request.
+ typedef base::Callback<void(const std::vector<uint8>&)> ValueCallback;
// Adds and removes observers for events on this GATT characteristic. If
// monitoring multiple characteristics, check the |characteristic| parameter
@@ -160,6 +164,13 @@ class BluetoothGattCharacteristic {
// returns false if this instance represents a remote characteristic.
virtual bool UpdateValue(const std::vector<uint8>& value) = 0;
+ // Sends a read request to a remote characteristic to read its value.
+ // |callback| is called to return the read value on success and
+ // |error_callback| is called for failures.
+ virtual void ReadRemoteCharacteristic(
+ const ValueCallback& callback,
+ const ErrorCallback& error_callback) = 0;
+
// Sends a write request to a remote characteristic, to modify the
// characteristic's value starting at offset |offset| with the new value
// |new_value|. |callback| is called to signal success and |error_callback|
« no previous file with comments | « device/bluetooth/bluetooth.gyp ('k') | device/bluetooth/bluetooth_gatt_descriptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698