OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_REMOTE_GATT_DESCRIPTOR_BLUEZ_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_DESCRIPTOR_BLUEZ_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_DESCRIPTOR_BLUEZ_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_DESCRIPTOR_BLUEZ_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <string> | 10 #include <string> |
9 #include <vector> | 11 #include <vector> |
10 | 12 |
11 #include "base/macros.h" | 13 #include "base/macros.h" |
12 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
13 #include "dbus/object_path.h" | 15 #include "dbus/object_path.h" |
14 #include "device/bluetooth/bluetooth_gatt_descriptor.h" | 16 #include "device/bluetooth/bluetooth_gatt_descriptor.h" |
15 #include "device/bluetooth/bluetooth_uuid.h" | 17 #include "device/bluetooth/bluetooth_uuid.h" |
16 | 18 |
17 namespace device { | 19 namespace device { |
18 | 20 |
19 class BluetoothGattCharacteristic; | 21 class BluetoothGattCharacteristic; |
20 | 22 |
21 } // namespace device | 23 } // namespace device |
22 | 24 |
23 namespace bluez { | 25 namespace bluez { |
24 | 26 |
25 class BluetoothRemoteGattCharacteristicBlueZ; | 27 class BluetoothRemoteGattCharacteristicBlueZ; |
26 | 28 |
27 // The BluetoothRemoteGattDescriptorBlueZ class implements | 29 // The BluetoothRemoteGattDescriptorBlueZ class implements |
28 // BluetoothGattDescriptor for remote GATT characteristic descriptors on the | 30 // BluetoothGattDescriptor for remote GATT characteristic descriptors on the |
29 // Chrome OS platform. | 31 // Chrome OS platform. |
30 class BluetoothRemoteGattDescriptorBlueZ | 32 class BluetoothRemoteGattDescriptorBlueZ |
31 : public device::BluetoothGattDescriptor { | 33 : public device::BluetoothGattDescriptor { |
32 public: | 34 public: |
33 // device::BluetoothGattDescriptor overrides. | 35 // device::BluetoothGattDescriptor overrides. |
34 std::string GetIdentifier() const override; | 36 std::string GetIdentifier() const override; |
35 device::BluetoothUUID GetUUID() const override; | 37 device::BluetoothUUID GetUUID() const override; |
36 bool IsLocal() const override; | 38 bool IsLocal() const override; |
37 const std::vector<uint8>& GetValue() const override; | 39 const std::vector<uint8_t>& GetValue() const override; |
38 device::BluetoothGattCharacteristic* GetCharacteristic() const override; | 40 device::BluetoothGattCharacteristic* GetCharacteristic() const override; |
39 device::BluetoothGattCharacteristic::Permissions GetPermissions() | 41 device::BluetoothGattCharacteristic::Permissions GetPermissions() |
40 const override; | 42 const override; |
41 void ReadRemoteDescriptor(const ValueCallback& callback, | 43 void ReadRemoteDescriptor(const ValueCallback& callback, |
42 const ErrorCallback& error_callback) override; | 44 const ErrorCallback& error_callback) override; |
43 void WriteRemoteDescriptor(const std::vector<uint8>& new_value, | 45 void WriteRemoteDescriptor(const std::vector<uint8_t>& new_value, |
44 const base::Closure& callback, | 46 const base::Closure& callback, |
45 const ErrorCallback& error_callback) override; | 47 const ErrorCallback& error_callback) override; |
46 | 48 |
47 // Object path of the underlying D-Bus characteristic. | 49 // Object path of the underlying D-Bus characteristic. |
48 const dbus::ObjectPath& object_path() const { return object_path_; } | 50 const dbus::ObjectPath& object_path() const { return object_path_; } |
49 | 51 |
50 private: | 52 private: |
51 friend class BluetoothRemoteGattCharacteristicBlueZ; | 53 friend class BluetoothRemoteGattCharacteristicBlueZ; |
52 | 54 |
53 BluetoothRemoteGattDescriptorBlueZ( | 55 BluetoothRemoteGattDescriptorBlueZ( |
(...skipping 16 matching lines...) Expand all Loading... |
70 // Note: This should remain the last member so it'll be destroyed and | 72 // Note: This should remain the last member so it'll be destroyed and |
71 // invalidate its weak pointers before any other members are destroyed. | 73 // invalidate its weak pointers before any other members are destroyed. |
72 base::WeakPtrFactory<BluetoothRemoteGattDescriptorBlueZ> weak_ptr_factory_; | 74 base::WeakPtrFactory<BluetoothRemoteGattDescriptorBlueZ> weak_ptr_factory_; |
73 | 75 |
74 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattDescriptorBlueZ); | 76 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattDescriptorBlueZ); |
75 }; | 77 }; |
76 | 78 |
77 } // namespace bluez | 79 } // namespace bluez |
78 | 80 |
79 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_DESCRIPTOR_BLUEZ_H_ | 81 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_DESCRIPTOR_BLUEZ_H_ |
OLD | NEW |