| 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_DBUS_BLUETOOTH_GATT_DESCRIPTOR_SERVICE_PROVIDER_H_ | 5 #ifndef DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_DESCRIPTOR_SERVICE_PROVIDER_H_ |
| 6 #define DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_DESCRIPTOR_SERVICE_PROVIDER_H_ | 6 #define DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_DESCRIPTOR_SERVICE_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 // Writes the descriptor's properties into the provided writer. If | 43 // Writes the descriptor's properties into the provided writer. If |
| 44 // value is not null, it is written also, otherwise no value property is | 44 // value is not null, it is written also, otherwise no value property is |
| 45 // written. | 45 // written. |
| 46 virtual void WriteProperties(dbus::MessageWriter* writer, | 46 virtual void WriteProperties(dbus::MessageWriter* writer, |
| 47 const std::vector<uint8_t>* value) {} | 47 const std::vector<uint8_t>* value) {} |
| 48 | 48 |
| 49 virtual const dbus::ObjectPath& object_path() const = 0; | 49 virtual const dbus::ObjectPath& object_path() const = 0; |
| 50 | 50 |
| 51 // Creates the instance, where |bus| is the D-Bus bus connection to export | 51 // Creates the instance, where |bus| is the D-Bus bus connection to export |
| 52 // the object onto, |uuid| is the 128-bit GATT descriptor UUID, |permissions| | 52 // the object onto, |uuid| is the 128-bit GATT descriptor UUID, |flags| |
| 53 // is the list of attribute permissions, |characteristic_path| is the object | 53 // is the list of attribute permissions, |characteristic_path| is the object |
| 54 // path of the exported GATT characteristic the descriptor belongs to, | 54 // path of the exported GATT characteristic the descriptor belongs to, |
| 55 // |object_path| is the object path that the descriptor should have, and | 55 // |object_path| is the object path that the descriptor should have, and |
| 56 // |delegate| is the object that value Get/Set requests will be passed to and | 56 // |delegate| is the object that value Get/Set requests will be passed to and |
| 57 // responses generated from. | 57 // responses generated from. |
| 58 // | 58 // |
| 59 // Object paths of GATT descriptors must be hierarchical to the path of the | 59 // Object paths of GATT descriptors must be hierarchical to the path of the |
| 60 // GATT characteristic they belong to. Hence, |object_path| must have | 60 // GATT characteristic they belong to. Hence, |object_path| must have |
| 61 // |characteristic_path| as its prefix. Ownership of |delegate| is not taken, | 61 // |characteristic_path| as its prefix. Ownership of |delegate| is not taken, |
| 62 // thus the delegate should outlive this instance. A delegate should handle | 62 // thus the delegate should outlive this instance. A delegate should handle |
| 63 // only a single exported descriptor and own it. | 63 // only a single exported descriptor and own it. |
| 64 static BluetoothGattDescriptorServiceProvider* Create( | 64 static BluetoothGattDescriptorServiceProvider* Create( |
| 65 dbus::Bus* bus, | 65 dbus::Bus* bus, |
| 66 const dbus::ObjectPath& object_path, | 66 const dbus::ObjectPath& object_path, |
| 67 std::unique_ptr<BluetoothGattAttributeValueDelegate> delegate, | 67 std::unique_ptr<BluetoothGattAttributeValueDelegate> delegate, |
| 68 const std::string& uuid, | 68 const std::string& uuid, |
| 69 const std::vector<std::string>& permissions, | 69 const std::vector<std::string>& flags, |
| 70 const dbus::ObjectPath& characteristic_path); | 70 const dbus::ObjectPath& characteristic_path); |
| 71 | 71 |
| 72 protected: | 72 protected: |
| 73 BluetoothGattDescriptorServiceProvider(); | 73 BluetoothGattDescriptorServiceProvider(); |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 DISALLOW_COPY_AND_ASSIGN(BluetoothGattDescriptorServiceProvider); | 76 DISALLOW_COPY_AND_ASSIGN(BluetoothGattDescriptorServiceProvider); |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 } // namespace bluez | 79 } // namespace bluez |
| 80 | 80 |
| 81 #endif // DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_DESCRIPTOR_SERVICE_PROVIDER_H_ | 81 #endif // DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_DESCRIPTOR_SERVICE_PROVIDER_H_ |
| OLD | NEW |