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

Unified Diff: device/bluetooth/dbus/bluetooth_gatt_descriptor_delegate_wrapper.h

Issue 1914893002: DBus changes for implementing local GATT attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth_classes
Patch Set: test leak fix Created 4 years, 8 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/dbus/bluetooth_gatt_descriptor_delegate_wrapper.h
diff --git a/device/bluetooth/dbus/bluetooth_gatt_descriptor_delegate_wrapper.h b/device/bluetooth/dbus/bluetooth_gatt_descriptor_delegate_wrapper.h
new file mode 100644
index 0000000000000000000000000000000000000000..8536b17ddda5ffb6878f2b16f454d7b6e33bb3b8
--- /dev/null
+++ b/device/bluetooth/dbus/bluetooth_gatt_descriptor_delegate_wrapper.h
@@ -0,0 +1,50 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_DESCRIPTOR_DELEGATE_WRAPPER_H_
+#define DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_DESCRIPTOR_DELEGATE_WRAPPER_H_
+
+#include <cstdint>
+#include <vector>
+
+#include "base/callback_forward.h"
+#include "base/macros.h"
+#include "device/bluetooth/bluetooth_local_gatt_service.h"
+#include "device/bluetooth/bluez/bluetooth_gatt_service_bluez.h"
+#include "device/bluetooth/bluez/bluetooth_local_gatt_service_bluez.h"
+#include "device/bluetooth/dbus/bluetooth_gatt_attribute_value_delegate.h"
+
+namespace bluez {
+
+class BluetoothLocalGattDescriptorBlueZ;
+
+// Wrapper class around AttributeValueDelegate to handle descriptors.
+class BluetoothGattDescriptorDelegateWrapper
+ : public BluetoothGattAttributeValueDelegate {
+ public:
+ BluetoothGattDescriptorDelegateWrapper(
+ BluetoothLocalGattServiceBlueZ* service,
+ BluetoothLocalGattDescriptorBlueZ* descriptor);
+
+ void GetValue(
+ const device::BluetoothLocalGattService::Delegate::ValueCallback&
+ callback,
+ const device::BluetoothLocalGattService::Delegate::ErrorCallback&
+ error_callback) override;
+ void SetValue(
+ const std::vector<uint8_t>& value,
+ const base::Closure& callback,
+ const device::BluetoothLocalGattService::Delegate::ErrorCallback&
+ error_callback) override;
+
+ private:
+ BluetoothLocalGattServiceBlueZ* service_;
+ BluetoothLocalGattDescriptorBlueZ* descriptor_;
+
+ DISALLOW_COPY_AND_ASSIGN(BluetoothGattDescriptorDelegateWrapper);
+};
+
+} // namespace bluez
+
+#endif // DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_DESCRIPTOR_DELEGATE_WRAPPER_H_

Powered by Google App Engine
This is Rietveld 408576698