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

Unified Diff: components/arc/bluetooth/arc_bluetooth_bridge.h

Issue 2101283003: arc: bluetooth: Implement Gatt server request to read/write (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gs2
Patch Set: Created 4 years, 6 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: components/arc/bluetooth/arc_bluetooth_bridge.h
diff --git a/components/arc/bluetooth/arc_bluetooth_bridge.h b/components/arc/bluetooth/arc_bluetooth_bridge.h
index 6ac811cbc8985721f098d7425ae2c0d8d4d593c7..09fc8dabc28d35724af07d84d8ceac807abbc93f 100644
--- a/components/arc/bluetooth/arc_bluetooth_bridge.h
+++ b/components/arc/bluetooth/arc_bluetooth_bridge.h
@@ -118,6 +118,22 @@ class ArcBluetoothBridge
const std::vector<uint8_t>& value) override;
// Overridden from device::BluetoothLocalGattService::Delegate
+ template <class T>
+ void OnGattAttributeReadRequest(const device::BluetoothDevice* device,
+ const T* gatt_obj,
+ int offset,
+ const ValueCallback& callback,
+ const ErrorCallback& error_callback);
+
+ template <class T>
+ void OnGattAttributeWriteRequest(
+ const device::BluetoothDevice* device,
+ const T* gatt_obj,
+ const std::vector<uint8_t>& value,
+ int offset,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) override;
+
void OnCharacteristicReadRequest(
const device::BluetoothDevice* device,
const device::BluetoothLocalGattCharacteristic* characteristic,
@@ -353,6 +369,10 @@ class ArcBluetoothBridge
template <class T>
int32_t CreateGattAttributeHandle(T* gatt_obj);
+ int32_t CreateGattReadTransaction(const ValueCallback& successCallback,
+ const ErrorCallback& errorCallback);
+ int32_t CreateGattWriteTransaction(const base::Closure& successCallback,
+ const ErrorCallback& errorCallback);
mojo::Binding<mojom::BluetoothHost> binding_;
@@ -363,6 +383,10 @@ class ArcBluetoothBridge
notification_session_;
// Map from android int handle to Chrome (BlueZ) string identifier.
std::map<int32_t, std::string> gatt_identifier_;
+ std::map<int32_t, std::pair<ValueCallback, ErrorCallback>>
rkc 2016/07/01 22:51:32 Can we have this aliased with using? It would also
puthik_chromium 2016/07/14 22:45:12 Done.
+ gatt_read_callbacks_;
+ std::map<int32_t, std::pair<base::Closure, ErrorCallback>>
+ gatt_write_callbacks_;
// WeakPtrFactory to use for callbacks.
base::WeakPtrFactory<ArcBluetoothBridge> weak_factory_;
« no previous file with comments | « no previous file | components/arc/bluetooth/arc_bluetooth_bridge.cc » ('j') | components/arc/bluetooth/arc_bluetooth_bridge.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698