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 #include "chromeos/dbus/bluetooth_gatt_descriptor_client.h" | 5 #include "chromeos/dbus/bluetooth_gatt_descriptor_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
10 #include "dbus/bus.h" | 10 #include "dbus/bus.h" |
11 #include "dbus/object_manager.h" | 11 #include "dbus/object_manager.h" |
12 #include "third_party/cros_system_api/dbus/service_constants.h" | 12 #include "third_party/cros_system_api/dbus/service_constants.h" |
13 | 13 |
14 namespace chromeos { | 14 namespace chromeos { |
15 | 15 |
| 16 namespace { |
| 17 |
| 18 // TODO(armansito): Move this constant to cros_system_api. |
| 19 const char kValueProperty[] = "Value"; |
| 20 |
| 21 } // namespace |
| 22 |
16 // static | 23 // static |
17 const char BluetoothGattDescriptorClient::kNoResponseError[] = | 24 const char BluetoothGattDescriptorClient::kNoResponseError[] = |
18 "org.chromium.Error.NoResponse"; | 25 "org.chromium.Error.NoResponse"; |
19 // static | 26 // static |
20 const char BluetoothGattDescriptorClient::kUnknownDescriptorError[] = | 27 const char BluetoothGattDescriptorClient::kUnknownDescriptorError[] = |
21 "org.chromium.Error.UnknownDescriptor"; | 28 "org.chromium.Error.UnknownDescriptor"; |
22 | 29 |
23 BluetoothGattDescriptorClient::Properties::Properties( | 30 BluetoothGattDescriptorClient::Properties::Properties( |
24 dbus::ObjectProxy* object_proxy, | 31 dbus::ObjectProxy* object_proxy, |
25 const std::string& interface_name, | 32 const std::string& interface_name, |
26 const PropertyChangedCallback&callback) | 33 const PropertyChangedCallback&callback) |
27 : dbus::PropertySet(object_proxy, interface_name, callback) { | 34 : dbus::PropertySet(object_proxy, interface_name, callback) { |
28 RegisterProperty(bluetooth_gatt_descriptor::kUUIDProperty, &uuid); | 35 RegisterProperty(bluetooth_gatt_descriptor::kUUIDProperty, &uuid); |
29 RegisterProperty(bluetooth_gatt_descriptor::kCharacteristicProperty, | 36 RegisterProperty(bluetooth_gatt_descriptor::kCharacteristicProperty, |
30 &characteristic); | 37 &characteristic); |
| 38 RegisterProperty(kValueProperty, &value); |
31 } | 39 } |
32 | 40 |
33 BluetoothGattDescriptorClient::Properties::~Properties() { | 41 BluetoothGattDescriptorClient::Properties::~Properties() { |
34 } | 42 } |
35 | 43 |
36 // The BluetoothGattDescriptorClient implementation used in production. | 44 // The BluetoothGattDescriptorClient implementation used in production. |
37 class BluetoothGattDescriptorClientImpl | 45 class BluetoothGattDescriptorClientImpl |
38 : public BluetoothGattDescriptorClient, | 46 : public BluetoothGattDescriptorClient, |
39 public dbus::ObjectManager::Interface { | 47 public dbus::ObjectManager::Interface { |
40 public: | 48 public: |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 259 |
252 BluetoothGattDescriptorClient::~BluetoothGattDescriptorClient() { | 260 BluetoothGattDescriptorClient::~BluetoothGattDescriptorClient() { |
253 } | 261 } |
254 | 262 |
255 // static | 263 // static |
256 BluetoothGattDescriptorClient* BluetoothGattDescriptorClient::Create() { | 264 BluetoothGattDescriptorClient* BluetoothGattDescriptorClient::Create() { |
257 return new BluetoothGattDescriptorClientImpl(); | 265 return new BluetoothGattDescriptorClientImpl(); |
258 } | 266 } |
259 | 267 |
260 } // namespace chromeos | 268 } // namespace chromeos |
OLD | NEW |