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

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

Issue 1973703002: Implement //device/bt changes for notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@notifications_dbus
Patch Set: Created 4 years, 7 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_BLUEZ_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_
6 #define DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_ 6 #define DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_
7 7
8 #include <cstdint>
8 #include <vector> 9 #include <vector>
9 10
10 #include "base/macros.h" 11 #include "base/macros.h"
11 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "device/bluetooth/bluetooth_gatt_characteristic.h"
12 #include "device/bluetooth/bluetooth_local_gatt_characteristic.h" 14 #include "device/bluetooth/bluetooth_local_gatt_characteristic.h"
13 #include "device/bluetooth/bluetooth_local_gatt_service.h"
14 #include "device/bluetooth/bluetooth_uuid.h" 15 #include "device/bluetooth/bluetooth_uuid.h"
15 #include "device/bluetooth/bluez/bluetooth_gatt_characteristic_bluez.h" 16 #include "device/bluetooth/bluez/bluetooth_gatt_characteristic_bluez.h"
16 #include "device/bluetooth/bluez/bluetooth_local_gatt_descriptor_bluez.h" 17 #include "device/bluetooth/bluez/bluetooth_local_gatt_descriptor_bluez.h"
17 18
18 namespace bluez { 19 namespace bluez {
19 20
20 class BluetoothLocalGattServiceBlueZ; 21 class BluetoothLocalGattServiceBlueZ;
21 22
22 // The BluetoothLocalGattCharacteristicBlueZ class implements 23 // The BluetoothLocalGattCharacteristicBlueZ class implements
23 // BluetoothLocalGattCharacteristic for local GATT characteristics for 24 // BluetoothLocalGattCharacteristic for local GATT characteristics for
24 // platforms that use BlueZ. 25 // platforms that use BlueZ.
25 class BluetoothLocalGattCharacteristicBlueZ 26 class BluetoothLocalGattCharacteristicBlueZ
26 : public BluetoothGattCharacteristicBlueZ, 27 : public BluetoothGattCharacteristicBlueZ,
27 public device::BluetoothLocalGattCharacteristic { 28 public device::BluetoothLocalGattCharacteristic {
28 public: 29 public:
29 BluetoothLocalGattCharacteristicBlueZ( 30 BluetoothLocalGattCharacteristicBlueZ(
30 const device::BluetoothUUID& uuid, 31 const device::BluetoothUUID& uuid,
31 Properties properties, 32 Properties properties,
32 BluetoothLocalGattServiceBlueZ* service); 33 BluetoothLocalGattServiceBlueZ* service);
33 ~BluetoothLocalGattCharacteristicBlueZ() override; 34 ~BluetoothLocalGattCharacteristicBlueZ() override;
34 35
35 // device::BluetoothLocalGattCharacteristic overrides. 36 // device::BluetoothGattCharacteristic overrides:
36 device::BluetoothUUID GetUUID() const override; 37 device::BluetoothUUID GetUUID() const override;
37 Properties GetProperties() const override; 38 Properties GetProperties() const override;
38 Permissions GetPermissions() const override; 39 Permissions GetPermissions() const override;
39 40
41 // device::BluetoothLocalGattCharacteristic overrides:
42 NotificationStatus NotifyValueChanged(const std::vector<uint8_t>& new_value,
43 bool indicate) override;
44
40 BluetoothLocalGattServiceBlueZ* GetService(); 45 BluetoothLocalGattServiceBlueZ* GetService();
41 46
42 const std::vector<std::unique_ptr<BluetoothLocalGattDescriptorBlueZ>>& 47 const std::vector<std::unique_ptr<BluetoothLocalGattDescriptorBlueZ>>&
43 GetDescriptors() const; 48 GetDescriptors() const;
44 49
45 private: 50 private:
46 friend class BluetoothLocalGattDescriptorBlueZ; 51 friend class BluetoothLocalGattDescriptorBlueZ;
47 // Needs access to weak_ptr_factory_. 52 // Needs access to weak_ptr_factory_.
48 friend device::BluetoothLocalGattCharacteristic; 53 friend device::BluetoothLocalGattCharacteristic;
49 54
(...skipping 16 matching lines...) Expand all
66 // Note: This should remain the last member so it'll be destroyed and 71 // Note: This should remain the last member so it'll be destroyed and
67 // invalidate its weak pointers before any other members are destroyed. 72 // invalidate its weak pointers before any other members are destroyed.
68 base::WeakPtrFactory<BluetoothLocalGattCharacteristicBlueZ> weak_ptr_factory_; 73 base::WeakPtrFactory<BluetoothLocalGattCharacteristicBlueZ> weak_ptr_factory_;
69 74
70 DISALLOW_COPY_AND_ASSIGN(BluetoothLocalGattCharacteristicBlueZ); 75 DISALLOW_COPY_AND_ASSIGN(BluetoothLocalGattCharacteristicBlueZ);
71 }; 76 };
72 77
73 } // namespace bluez 78 } // namespace bluez
74 79
75 #endif // DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_ 80 #endif // DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_
OLDNEW
« no previous file with comments | « device/bluetooth/bluez/bluetooth_adapter_bluez.cc ('k') | device/bluetooth/bluez/bluetooth_local_gatt_characteristic_bluez.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698