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

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: Rebase to head Created 4 years, 5 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 | « no previous file | components/arc/bluetooth/arc_bluetooth_bridge.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 515afa39ba99d3744611795b78876b55506fa480..81208367b67717f53dbc49f375a0692decc9f568 100644
--- a/components/arc/bluetooth/arc_bluetooth_bridge.h
+++ b/components/arc/bluetooth/arc_bluetooth_bridge.h
@@ -43,8 +43,7 @@ class ArcBluetoothBridge
explicit ArcBluetoothBridge(ArcBridgeService* bridge_service);
~ArcBluetoothBridge() override;
- // Overridden from
- // InstanceHolder<mojom::BluetoothInstance>::Observer:
+ // Overridden from InstanceHolder<mojom::BluetoothInstance>::Observer:
void OnInstanceReady() override;
void OnAdapterInitialized(scoped_refptr<device::BluetoothAdapter> adapter);
@@ -346,6 +345,23 @@ class ArcBluetoothBridge
template <class LocalGattAttribute>
int32_t CreateGattAttributeHandle(LocalGattAttribute* attribute);
+ // Common code for OnCharacteristicReadRequest and OnDescriptorReadRequest
+ template <class LocalGattAttribute>
+ void OnGattAttributeReadRequest(const device::BluetoothDevice* device,
+ const LocalGattAttribute* attribute,
+ int offset,
+ const ValueCallback& success_callback,
+ const ErrorCallback& error_callback);
+
+ // Common code for OnCharacteristicWriteRequest and OnDescriptorWriteRequest
+ template <class LocalGattAttribute>
+ void OnGattAttributeWriteRequest(const device::BluetoothDevice* device,
+ const LocalGattAttribute* attribute,
+ const std::vector<uint8_t>& value,
+ int offset,
+ const base::Closure& success_callback,
+ const ErrorCallback& error_callback);
+
bool CalledOnValidThread();
mojo::Binding<mojom::BluetoothHost> binding_;
@@ -358,6 +374,8 @@ class ArcBluetoothBridge
notification_session_;
// Map from Android int handle to Chrome (BlueZ) string identifier.
std::unordered_map<int32_t, std::string> gatt_identifier_;
+ // Map from Chrome (BlueZ) string identifier to android int handle.
+ std::unordered_map<std::string, int32_t> gatt_handle_;
// Store last GattCharacteristic added to each GattService for GattServer.
std::unordered_map<int32_t, int32_t> last_characteristic_;
// Monotonically increasing value to use as handle to give to Android side.
« no previous file with comments | « no previous file | components/arc/bluetooth/arc_bluetooth_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698