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

Side by Side Diff: device/bluetooth/bluez/bluetooth_local_gatt_characteristic_bluez.h

Issue 1898643002: Refactor device::BluetoothGattXXX classes to split into remote/local. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor cleanup 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_ 6 #define DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_
7 7
8 #include <stdint.h>
9 #include <vector>
10
11 #include "base/callback_forward.h"
12 #include "base/macros.h" 8 #include "base/macros.h"
13 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
14 #include "dbus/object_path.h" 10 #include "dbus/object_path.h"
15 #include "device/bluetooth/bluetooth_gatt_characteristic_bluez.h" 11 #include "device/bluetooth/bluetooth_local_gatt_characteristic.h"
16 #include "device/bluetooth/bluetooth_uuid.h" 12 #include "device/bluetooth/bluez/bluetooth_gatt_characteristic_bluez.h"
17
18 namespace device {
19
20 class BluetoothGattDescriptor;
21 class BluetoothGattService;
22
23 } // namespace device
24 13
25 namespace bluez { 14 namespace bluez {
26 15
27 class BluetoothLocalGattDescriptorBlueZ;
28 class BluetoothLocalGattServiceBlueZ; 16 class BluetoothLocalGattServiceBlueZ;
29 17
30 // The BluetoothLocalGattCharacteristicBlueZ class implements 18 // The BluetoothLocalGattCharacteristicBlueZ class implements
31 // BluetoothGattCharacteristic for remote GATT characteristics for platforms 19 // BluetoothRemoteGattCharacteristic for remote GATT characteristics for
scheib 2016/04/20 01:23:30 implements ...Local...
rkc 2016/04/20 16:31:55 Done.
32 // that use BlueZ. 20 // platforms that use BlueZ.
33 class BluetoothLocalGattCharacteristicBlueZ 21 class BluetoothLocalGattCharacteristicBlueZ
34 : public BluetoothGattCharacteristicBlueZ { 22 : public BluetoothGattCharacteristicBlueZ,
23 public device::BluetoothLocalGattCharacteristic {
35 public: 24 public:
36 // device::BluetoothGattCharacteristic overrides.
37 device::BluetoothUUID GetUUID() const override;
38 bool IsLocal() const override;
39 const std::vector<uint8_t>& GetValue() const override;
40 Properties GetProperties() const override;
41 bool IsNotifying() const override;
42 bool AddDescriptor(device::BluetoothGattDescriptor* descriptor) override;
43 bool UpdateValue(const std::vector<uint8_t>& value) override;
44 void StartNotifySession(const NotifySessionCallback& callback,
45 const ErrorCallback& error_callback) override;
46 void ReadRemoteCharacteristic(const ValueCallback& callback,
47 const ErrorCallback& error_callback) override;
48 void WriteRemoteCharacteristic(const std::vector<uint8_t>& new_value,
49 const base::Closure& callback,
50 const ErrorCallback& error_callback) override;
51
52 private: 25 private:
53 friend class BluetoothLocalGattServiceBlueZ; 26 friend class BluetoothLocalGattServiceBlueZ;
54 27
55 BluetoothLocalGattCharacteristicBlueZ(BluetoothLocalGattServiceBlueZ* service, 28 BluetoothLocalGattCharacteristicBlueZ(BluetoothLocalGattServiceBlueZ* service,
56 const dbus::ObjectPath& object_path); 29 const dbus::ObjectPath& object_path);
57 ~BluetoothLocalGattCharacteristicBlueZ() override; 30 ~BluetoothLocalGattCharacteristicBlueZ() override;
58 31
59 // Note: This should remain the last member so it'll be destroyed and 32 // Note: This should remain the last member so it'll be destroyed and
60 // invalidate its weak pointers before any other members are destroyed. 33 // invalidate its weak pointers before any other members are destroyed.
61 base::WeakPtrFactory<BluetoothLocalGattCharacteristicBlueZ> weak_ptr_factory_; 34 base::WeakPtrFactory<BluetoothLocalGattCharacteristicBlueZ> weak_ptr_factory_;
62 35
63 DISALLOW_COPY_AND_ASSIGN(BluetoothLocalGattCharacteristicBlueZ); 36 DISALLOW_COPY_AND_ASSIGN(BluetoothLocalGattCharacteristicBlueZ);
64 }; 37 };
65 38
66 } // namespace bluez 39 } // namespace bluez
67 40
68 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_ 41 #endif // DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698