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

Side by Side Diff: device/bluetooth/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: 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_
7
8 #include <stdint.h>
9 #include <vector>
10
11 #include "base/callback_forward.h"
12 #include "base/macros.h"
13 #include "base/memory/weak_ptr.h"
14 #include "dbus/object_path.h"
15 #include "device/bluetooth/bluetooth_gatt_characteristic_bluez.h"
16 #include "device/bluetooth/bluetooth_uuid.h"
17
18 namespace device {
19
20 class BluetoothGattDescriptor;
21 class BluetoothGattService;
22
23 } // namespace device
24
25 namespace bluez {
26
27 class BluetoothLocalGattDescriptorBlueZ;
28 class BluetoothLocalGattServiceBlueZ;
29
30 // The BluetoothLocalGattCharacteristicBlueZ class implements
31 // BluetoothGattCharacteristic for remote GATT characteristics for platforms
32 // that use BlueZ.
33 class BluetoothLocalGattCharacteristicBlueZ
34 : public BluetoothGattCharacteristicBlueZ {
35 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:
53 friend class BluetoothLocalGattServiceBlueZ;
54
55 BluetoothLocalGattCharacteristicBlueZ(BluetoothLocalGattServiceBlueZ* service,
56 const dbus::ObjectPath& object_path);
57 ~BluetoothLocalGattCharacteristicBlueZ() override;
58
59 // Note: This should remain the last member so it'll be destroyed and
60 // invalidate its weak pointers before any other members are destroyed.
61 base::WeakPtrFactory<BluetoothLocalGattCharacteristicBlueZ> weak_ptr_factory_;
62
63 DISALLOW_COPY_AND_ASSIGN(BluetoothLocalGattCharacteristicBlueZ);
64 };
65
66 } // namespace bluez
67
68 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_local_gatt_characteristic.cc ('k') | device/bluetooth/bluetooth_local_gatt_characteristic_bluez.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698