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

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

Issue 1915803002: Bluetooth class changes for implementing 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..7ec16406e0f783b6bfbed7fa26251bd273c48623 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;
+ 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);
+ BluetoothLocalGattCharacteristicBlueZ(
+ const device::BluetoothUUID& uuid,
+ BluetoothLocalGattServiceBlueZ* service);
~BluetoothLocalGattCharacteristicBlueZ() override;
+ // device::BluetoothLocalGattCharacteristic overrides.
+ device::BluetoothUUID GetUUID() const override;
scheib 2016/04/28 01:06:24 GetUUID: either make not implemented, test in this
rkc 2016/04/28 02:06:58 Added code to test this for characteristics and de
+ Properties GetProperties() const override;
+ Permissions GetPermissions() const override;
+
+ BluetoothLocalGattServiceBlueZ* GetService();
+
+ const std::vector<std::unique_ptr<BluetoothLocalGattDescriptorBlueZ>>&
+ GetDescriptors() const;
+
+ 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