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

Unified Diff: device/bluetooth/bluez/bluetooth_local_gatt_characteristic_bluez.h

Issue 1920693002: Complete //device/bt implementation for hosting local GATT attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/bluez/bluetooth_local_gatt_characteristic_bluez.h
diff --git a/device/bluetooth/bluez/bluetooth_local_gatt_characteristic_bluez.h b/device/bluetooth/bluez/bluetooth_local_gatt_characteristic_bluez.h
index 466d67debc8b44e2e42d5eccfbec7891d9435e6c..0230a6181427c754494a5fd38c4cadee5962d664 100644
--- a/device/bluetooth/bluez/bluetooth_local_gatt_characteristic_bluez.h
+++ b/device/bluetooth/bluez/bluetooth_local_gatt_characteristic_bluez.h
@@ -5,11 +5,15 @@
#ifndef DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_
#define DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_
+#include <vector>
+
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
-#include "dbus/object_path.h"
#include "device/bluetooth/bluetooth_local_gatt_characteristic.h"
+#include "device/bluetooth/bluetooth_local_gatt_service.h"
+#include "device/bluetooth/bluetooth_uuid.h"
#include "device/bluetooth/bluez/bluetooth_gatt_characteristic_bluez.h"
+#include "device/bluetooth/bluez/bluetooth_local_gatt_descriptor_bluez.h"
namespace bluez {
@@ -22,13 +26,43 @@ class BluetoothLocalGattCharacteristicBlueZ
: public BluetoothGattCharacteristicBlueZ,
public device::BluetoothLocalGattCharacteristic {
public:
- private:
- friend class BluetoothLocalGattServiceBlueZ;
+ // device::BluetoothLocalGattCharacteristic overrides.
+ device::BluetoothUUID GetUUID() const override;
+ Properties GetProperties() const override;
+ Permissions GetPermissions() const override;
+
+ static base::WeakPtr<device::BluetoothLocalGattCharacteristic> Create(
+ const device::BluetoothUUID& uuid,
+ BluetoothGattCharacteristic::Properties properties,
+ BluetoothGattCharacteristic::Permissions permissions,
+ device::BluetoothLocalGattService* service);
- BluetoothLocalGattCharacteristicBlueZ(BluetoothLocalGattServiceBlueZ* service,
- const dbus::ObjectPath& object_path);
+ BluetoothLocalGattServiceBlueZ* GetService();
+
+ const std::vector<std::unique_ptr<BluetoothLocalGattDescriptorBlueZ>>&
+ GetDescriptors() const;
+
+ BluetoothLocalGattCharacteristicBlueZ(
+ const device::BluetoothUUID& uuid,
+ BluetoothLocalGattServiceBlueZ* service);
~BluetoothLocalGattCharacteristicBlueZ() override;
+ private:
+ friend class BluetoothLocalGattDescriptorBlueZ;
+
+ // Adds a descriptor to this characteristic.
+ void AddDescriptor(
+ std::unique_ptr<BluetoothLocalGattDescriptorBlueZ> descriptor);
+
+ // UUID of this characteristic.
+ device::BluetoothUUID uuid_;
+
+ // Service that contains this characteristic.
+ BluetoothLocalGattServiceBlueZ* service_;
+
+ // Descriptors contained by this characteristic.
+ std::vector<std::unique_ptr<BluetoothLocalGattDescriptorBlueZ>> descriptors_;
+
// Note: This should remain the last member so it'll be destroyed and
// invalidate its weak pointers before any other members are destroyed.
base::WeakPtrFactory<BluetoothLocalGattCharacteristicBlueZ> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698