| 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 CHROMEOS_DBUS_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_ | 6 #define CHROMEOS_DBUS_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 11 #include "base/callback.h" | 12 #include "base/callback.h" |
| 12 #include "chromeos/chromeos_export.h" | 13 #include "chromeos/chromeos_export.h" |
| 13 #include "chromeos/dbus/dbus_client.h" | 14 #include "chromeos/dbus/dbus_client.h" |
| 14 #include "dbus/object_path.h" | 15 #include "dbus/object_path.h" |
| 15 #include "dbus/property.h" | 16 #include "dbus/property.h" |
| 16 | 17 |
| 17 namespace chromeos { | 18 namespace chromeos { |
| 18 | 19 |
| 19 // BluetoothGattDescriptorClient is used to communicate with remote GATT | 20 // BluetoothGattDescriptorClient is used to communicate with remote GATT |
| 20 // characteristic descriptor objects exposed by the Bluetooth daemon. | 21 // characteristic descriptor objects exposed by the Bluetooth daemon. |
| 21 class CHROMEOS_EXPORT BluetoothGattDescriptorClient : public DBusClient { | 22 class CHROMEOS_EXPORT BluetoothGattDescriptorClient : public DBusClient { |
| 22 public: | 23 public: |
| 23 // Structure of properties associated with GATT descriptors. | 24 // Structure of properties associated with GATT descriptors. |
| 24 struct Properties : public dbus::PropertySet { | 25 struct Properties : public dbus::PropertySet { |
| 25 // The 128-bit characteristic descriptor UUID. [read-only] | 26 // The 128-bit characteristic descriptor UUID. [read-only] |
| 26 dbus::Property<std::string> uuid; | 27 dbus::Property<std::string> uuid; |
| 27 | 28 |
| 28 // Object path of the GATT characteristic the descriptor belongs to. | 29 // Object path of the GATT characteristic the descriptor belongs to. |
| 29 // [read-only] | 30 // [read-only] |
| 30 dbus::Property<dbus::ObjectPath> characteristic; | 31 dbus::Property<dbus::ObjectPath> characteristic; |
| 31 | 32 |
| 33 // The cached value of the descriptor. This property gets updated only after |
| 34 // a successful read request. [read-only] |
| 35 dbus::Property<std::vector<uint8_t>> value; |
| 36 |
| 32 Properties(dbus::ObjectProxy* object_proxy, | 37 Properties(dbus::ObjectProxy* object_proxy, |
| 33 const std::string& interface_name, | 38 const std::string& interface_name, |
| 34 const PropertyChangedCallback& callback); | 39 const PropertyChangedCallback& callback); |
| 35 virtual ~Properties(); | 40 virtual ~Properties(); |
| 36 }; | 41 }; |
| 37 | 42 |
| 38 // Interface for observing changes from a remote GATT characteristic | 43 // Interface for observing changes from a remote GATT characteristic |
| 39 // descriptor. | 44 // descriptor. |
| 40 class Observer { | 45 class Observer { |
| 41 public: | 46 public: |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 protected: | 106 protected: |
| 102 BluetoothGattDescriptorClient(); | 107 BluetoothGattDescriptorClient(); |
| 103 | 108 |
| 104 private: | 109 private: |
| 105 DISALLOW_COPY_AND_ASSIGN(BluetoothGattDescriptorClient); | 110 DISALLOW_COPY_AND_ASSIGN(BluetoothGattDescriptorClient); |
| 106 }; | 111 }; |
| 107 | 112 |
| 108 } // namespace chromeos | 113 } // namespace chromeos |
| 109 | 114 |
| 110 #endif // CHROMEOS_DBUS_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_ | 115 #endif // CHROMEOS_DBUS_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_ |
| OLD | NEW |