Chromium Code Reviews| 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_CHARACTERISTIC_SERVICE_PROVIDER_H_ | 5 #ifndef DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_CHARACTERISTIC_SERVICE_PROVIDER_H_ |
| 6 #define DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_CHARACTERISTIC_SERVICE_PROVIDER_H_ | 6 #define DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_CHARACTERISTIC_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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 // Writes the characteristics's properties into the provided writer. If | 43 // Writes the characteristics'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 characteristic UUID, | 52 // the object onto, |uuid| is the 128-bit GATT characteristic UUID, |
| 53 // |flags| is the list of GATT characteristic properties, |permissions| is the | 53 // |flags| is the list of GATT characteristic properties, |permissions| is the |
|
hashimoto
2016/05/07 04:06:13
Please revise the comment.
rkc
2016/05/07 19:55:43
Done.
| |
| 54 // list of attribute permissions, |service_path| is the object path of the | 54 // list of attribute permissions, |service_path| is the object path of the |
| 55 // exported GATT service the characteristic belongs to, |object_path| is the | 55 // exported GATT service the characteristic belongs to, |object_path| is the |
| 56 // object path that the characteristic should have, and |delegate| is the | 56 // object path that the characteristic should have, and |delegate| is the |
| 57 // object that "Value" Get/Set requests will be passed to and responses | 57 // object that "Value" Get/Set requests will be passed to and responses |
| 58 // generated from. | 58 // generated from. |
| 59 // | 59 // |
| 60 // Object paths of GATT characteristics must be hierarchical to the path of | 60 // Object paths of GATT characteristics must be hierarchical to the path of |
| 61 // the GATT service they belong to. Hence, |object_path| must have | 61 // the GATT service they belong to. Hence, |object_path| must have |
| 62 // |service_path| as its prefix. Ownership of |delegate| is not taken, thus | 62 // |service_path| as its prefix. Ownership of |delegate| is not taken, thus |
| 63 // the delegate should outlive this instance. A delegate should handle only | 63 // the delegate should outlive this instance. A delegate should handle only |
| 64 // a single exported characteristic and own it. | 64 // a single exported characteristic and own it. |
| 65 static BluetoothGattCharacteristicServiceProvider* Create( | 65 static BluetoothGattCharacteristicServiceProvider* Create( |
| 66 dbus::Bus* bus, | 66 dbus::Bus* bus, |
| 67 const dbus::ObjectPath& object_path, | 67 const dbus::ObjectPath& object_path, |
| 68 std::unique_ptr<BluetoothGattAttributeValueDelegate> delegate, | 68 std::unique_ptr<BluetoothGattAttributeValueDelegate> delegate, |
| 69 const std::string& uuid, | 69 const std::string& uuid, |
| 70 const std::vector<std::string>& flags, | 70 const std::vector<std::string>& flags, |
| 71 const std::vector<std::string>& permissions, | |
| 72 const dbus::ObjectPath& service_path); | 71 const dbus::ObjectPath& service_path); |
| 73 | 72 |
| 74 protected: | 73 protected: |
| 75 BluetoothGattCharacteristicServiceProvider(); | 74 BluetoothGattCharacteristicServiceProvider(); |
| 76 | 75 |
| 77 private: | 76 private: |
| 78 DISALLOW_COPY_AND_ASSIGN(BluetoothGattCharacteristicServiceProvider); | 77 DISALLOW_COPY_AND_ASSIGN(BluetoothGattCharacteristicServiceProvider); |
| 79 }; | 78 }; |
| 80 | 79 |
| 81 } // namespace bluez | 80 } // namespace bluez |
| 82 | 81 |
| 83 #endif // DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_CHARACTERISTIC_SERVICE_PROVIDER_ H_ | 82 #endif // DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_CHARACTERISTIC_SERVICE_PROVIDER_ H_ |
| OLD | NEW |