Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: device/bluetooth/bluetooth_remote_gatt_service_bluez.cc

Issue 1872943002: Add support for local services/characteristics/descriptors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "device/bluetooth/bluetooth_remote_gatt_service_bluez.h" 5 #include "device/bluetooth/bluetooth_remote_gatt_service_bluez.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "device/bluetooth/bluetooth_adapter_bluez.h" 9 #include "device/bluetooth/bluetooth_adapter_bluez.h"
10 #include "device/bluetooth/bluetooth_device_bluez.h" 10 #include "device/bluetooth/bluetooth_device_bluez.h"
11 #include "device/bluetooth/bluetooth_gatt_descriptor_bluez.h"
11 #include "device/bluetooth/bluetooth_remote_gatt_characteristic_bluez.h" 12 #include "device/bluetooth/bluetooth_remote_gatt_characteristic_bluez.h"
12 #include "device/bluetooth/bluetooth_remote_gatt_descriptor_bluez.h" 13 #include "device/bluetooth/dbus/bluetooth_gatt_manager_client.h"
13 #include "device/bluetooth/dbus/bluetooth_gatt_service_client.h" 14 #include "device/bluetooth/dbus/bluetooth_gatt_service_client.h"
14 #include "device/bluetooth/dbus/bluez_dbus_manager.h" 15 #include "device/bluetooth/dbus/bluez_dbus_manager.h"
15 16
16 namespace bluez { 17 namespace bluez {
17 18
18 namespace { 19 namespace {
19 20
20 // TODO(jamuraa) move these to cros_system_api later 21 // TODO(jamuraa) move these to cros_system_api later
21 const char kErrorFailed[] = "org.bluez.Error.Failed"; 22 const char kErrorFailed[] = "org.bluez.Error.Failed";
22 const char kErrorInProgress[] = "org.bluez.Error.InProgress"; 23 const char kErrorInProgress[] = "org.bluez.Error.InProgress";
23 const char kErrorInvalidValueLength[] = "org.bluez.Error.InvalidValueLength"; 24 const char kErrorInvalidValueLength[] = "org.bluez.Error.InvalidValueLength";
24 const char kErrorNotAuthorized[] = "org.bluez.Error.NotAuthorized"; 25 const char kErrorNotAuthorized[] = "org.bluez.Error.NotAuthorized";
25 const char kErrorNotPaired[] = "org.bluez.Error.NotPaired"; 26 const char kErrorNotPaired[] = "org.bluez.Error.NotPaired";
26 const char kErrorNotSupported[] = "org.bluez.Error.NotSupported"; 27 const char kErrorNotSupported[] = "org.bluez.Error.NotSupported";
27 const char kErrorNotPermitted[] = "org.bluez.Error.NotPermitted"; 28 const char kErrorNotPermitted[] = "org.bluez.Error.NotPermitted";
28 29
29 } // namespace 30 } // namespace
30 31
31 BluetoothRemoteGattServiceBlueZ::BluetoothRemoteGattServiceBlueZ( 32 BluetoothRemoteGattServiceBlueZ::BluetoothRemoteGattServiceBlueZ(
32 BluetoothAdapterBlueZ* adapter, 33 BluetoothAdapterBlueZ* adapter,
33 BluetoothDeviceBlueZ* device, 34 BluetoothDeviceBlueZ* device,
34 const dbus::ObjectPath& object_path) 35 const dbus::ObjectPath& object_path)
35 : object_path_(object_path), 36 : BluetoothGattServiceBlueZ(adapter, device, object_path),
36 adapter_(adapter),
37 device_(device),
38 discovery_complete_(false), 37 discovery_complete_(false),
39 weak_ptr_factory_(this) { 38 weak_ptr_factory_(this) {
40 VLOG(1) << "Creating remote GATT service with identifier: " 39 VLOG(1) << "Creating remote GATT service with identifier: "
41 << object_path.value() << ", UUID: " << GetUUID().canonical_value(); 40 << object_path.value() << ", UUID: " << GetUUID().canonical_value();
42 DCHECK(adapter_); 41 DCHECK(GetAdapter());
43 42
44 bluez::BluezDBusManager::Get()->GetBluetoothGattServiceClient()->AddObserver( 43 bluez::BluezDBusManager::Get()->GetBluetoothGattServiceClient()->AddObserver(
45 this); 44 this);
46 bluez::BluezDBusManager::Get() 45 bluez::BluezDBusManager::Get()
47 ->GetBluetoothGattCharacteristicClient() 46 ->GetBluetoothGattCharacteristicClient()
48 ->AddObserver(this); 47 ->AddObserver(this);
49 48
50 // Add all known GATT characteristics. 49 // Add all known GATT characteristics.
51 const std::vector<dbus::ObjectPath>& gatt_chars = 50 const std::vector<dbus::ObjectPath>& gatt_chars =
52 bluez::BluezDBusManager::Get() 51 bluez::BluezDBusManager::Get()
(...skipping 12 matching lines...) Expand all
65 ->GetBluetoothGattCharacteristicClient() 64 ->GetBluetoothGattCharacteristicClient()
66 ->RemoveObserver(this); 65 ->RemoveObserver(this);
67 66
68 // Clean up all the characteristics. Copy the characteristics list here and 67 // Clean up all the characteristics. Copy the characteristics list here and
69 // clear the original so that when we send GattCharacteristicRemoved(), 68 // clear the original so that when we send GattCharacteristicRemoved(),
70 // GetCharacteristics() returns no characteristics. 69 // GetCharacteristics() returns no characteristics.
71 CharacteristicMap characteristics = characteristics_; 70 CharacteristicMap characteristics = characteristics_;
72 characteristics_.clear(); 71 characteristics_.clear();
73 for (CharacteristicMap::iterator iter = characteristics.begin(); 72 for (CharacteristicMap::iterator iter = characteristics.begin();
74 iter != characteristics.end(); ++iter) { 73 iter != characteristics.end(); ++iter) {
75 DCHECK(adapter_); 74 DCHECK(GetAdapter());
76 adapter_->NotifyGattCharacteristicRemoved(iter->second); 75 GetAdapter()->NotifyGattCharacteristicRemoved(iter->second);
77 76
78 delete iter->second; 77 delete iter->second;
79 } 78 }
80 } 79 }
81 80
82 std::string BluetoothRemoteGattServiceBlueZ::GetIdentifier() const {
83 return object_path_.value();
84 }
85
86 device::BluetoothUUID BluetoothRemoteGattServiceBlueZ::GetUUID() const {
87 bluez::BluetoothGattServiceClient::Properties* properties =
88 bluez::BluezDBusManager::Get()
89 ->GetBluetoothGattServiceClient()
90 ->GetProperties(object_path_);
91 DCHECK(properties);
92 return device::BluetoothUUID(properties->uuid.value());
93 }
94
95 bool BluetoothRemoteGattServiceBlueZ::IsLocal() const { 81 bool BluetoothRemoteGattServiceBlueZ::IsLocal() const {
96 return false; 82 return false;
97 } 83 }
98 84
99 bool BluetoothRemoteGattServiceBlueZ::IsPrimary() const {
100 bluez::BluetoothGattServiceClient::Properties* properties =
101 bluez::BluezDBusManager::Get()
102 ->GetBluetoothGattServiceClient()
103 ->GetProperties(object_path_);
104 DCHECK(properties);
105 return properties->primary.value();
106 }
107
108 device::BluetoothDevice* BluetoothRemoteGattServiceBlueZ::GetDevice() const {
109 return device_;
110 }
111
112 std::vector<device::BluetoothGattCharacteristic*>
113 BluetoothRemoteGattServiceBlueZ::GetCharacteristics() const {
114 std::vector<device::BluetoothGattCharacteristic*> characteristics;
115 for (CharacteristicMap::const_iterator iter = characteristics_.begin();
116 iter != characteristics_.end(); ++iter) {
117 characteristics.push_back(iter->second);
118 }
119 return characteristics;
120 }
121
122 std::vector<device::BluetoothGattService*>
123 BluetoothRemoteGattServiceBlueZ::GetIncludedServices() const {
124 // TODO(armansito): Return the actual included services here.
125 return std::vector<device::BluetoothGattService*>();
126 }
127
128 device::BluetoothGattCharacteristic*
129 BluetoothRemoteGattServiceBlueZ::GetCharacteristic(
130 const std::string& identifier) const {
131 CharacteristicMap::const_iterator iter =
132 characteristics_.find(dbus::ObjectPath(identifier));
133 if (iter == characteristics_.end())
134 return NULL;
135 return iter->second;
136 }
137
138 bool BluetoothRemoteGattServiceBlueZ::AddCharacteristic( 85 bool BluetoothRemoteGattServiceBlueZ::AddCharacteristic(
139 device::BluetoothGattCharacteristic* characteristic) { 86 device::BluetoothGattCharacteristic* characteristic) {
140 VLOG(1) << "Characteristics cannot be added to a remote GATT service."; 87 VLOG(1) << "Characteristics cannot be added to a remote GATT service.";
141 return false; 88 return false;
142 } 89 }
143 90
144 bool BluetoothRemoteGattServiceBlueZ::AddIncludedService( 91 bool BluetoothRemoteGattServiceBlueZ::AddIncludedService(
145 device::BluetoothGattService* service) { 92 device::BluetoothGattService* service) {
146 VLOG(1) << "Included services cannot be added to a remote GATT service."; 93 VLOG(1) << "Included services cannot be added to a remote GATT service.";
147 return false; 94 return false;
148 } 95 }
149 96
150 void BluetoothRemoteGattServiceBlueZ::Register( 97 void BluetoothRemoteGattServiceBlueZ::Register(
151 const base::Closure& callback, 98 const base::Closure& callback,
152 const ErrorCallback& error_callback) { 99 const ErrorCallback& error_callback) {
153 VLOG(1) << "A remote GATT service cannot be registered."; 100 VLOG(1) << "A remote GATT service cannot be registered.";
154 error_callback.Run(); 101 error_callback.Run("Invalid", "Register is invalid for remote services.");
155 } 102 }
156 103
157 void BluetoothRemoteGattServiceBlueZ::Unregister( 104 void BluetoothRemoteGattServiceBlueZ::Unregister(
158 const base::Closure& callback, 105 const base::Closure& callback,
159 const ErrorCallback& error_callback) { 106 const ErrorCallback& error_callback) {
160 VLOG(1) << "A remote GATT service cannot be unregistered."; 107 VLOG(1) << "A remote GATT service cannot be unregistered.";
161 error_callback.Run(); 108 error_callback.Run("Invalid", "Unregister is invalid for remote services.");
162 } 109 }
163 110
164 // static 111 // static
165 device::BluetoothGattService::GattErrorCode 112 device::BluetoothGattService::GattErrorCode
166 BluetoothRemoteGattServiceBlueZ::DBusErrorToServiceError( 113 BluetoothRemoteGattServiceBlueZ::DBusErrorToServiceError(
167 std::string error_name) { 114 std::string error_name) {
168 device::BluetoothGattService::GattErrorCode code = GATT_ERROR_UNKNOWN; 115 device::BluetoothGattService::GattErrorCode code = GATT_ERROR_UNKNOWN;
169 if (error_name == kErrorFailed) { 116 if (error_name == kErrorFailed) {
170 code = GATT_ERROR_FAILED; 117 code = GATT_ERROR_FAILED;
171 } else if (error_name == kErrorInProgress) { 118 } else if (error_name == kErrorInProgress) {
172 code = GATT_ERROR_IN_PROGRESS; 119 code = GATT_ERROR_IN_PROGRESS;
173 } else if (error_name == kErrorInvalidValueLength) { 120 } else if (error_name == kErrorInvalidValueLength) {
174 code = GATT_ERROR_INVALID_LENGTH; 121 code = GATT_ERROR_INVALID_LENGTH;
175 } else if (error_name == kErrorNotPermitted) { 122 } else if (error_name == kErrorNotPermitted) {
176 code = GATT_ERROR_NOT_PERMITTED; 123 code = GATT_ERROR_NOT_PERMITTED;
177 } else if (error_name == kErrorNotAuthorized) { 124 } else if (error_name == kErrorNotAuthorized) {
178 code = GATT_ERROR_NOT_AUTHORIZED; 125 code = GATT_ERROR_NOT_AUTHORIZED;
179 } else if (error_name == kErrorNotPaired) { 126 } else if (error_name == kErrorNotPaired) {
180 code = GATT_ERROR_NOT_PAIRED; 127 code = GATT_ERROR_NOT_PAIRED;
181 } else if (error_name == kErrorNotSupported) { 128 } else if (error_name == kErrorNotSupported) {
182 code = GATT_ERROR_NOT_SUPPORTED; 129 code = GATT_ERROR_NOT_SUPPORTED;
183 } 130 }
184 return code; 131 return code;
185 } 132 }
186 133
187 BluetoothAdapterBlueZ* BluetoothRemoteGattServiceBlueZ::GetAdapter() const {
188 return adapter_;
189 }
190
191 void BluetoothRemoteGattServiceBlueZ::NotifyServiceChanged() { 134 void BluetoothRemoteGattServiceBlueZ::NotifyServiceChanged() {
192 // Don't send service changed unless we know that all characteristics have 135 // Don't send service changed unless we know that all characteristics have
193 // already been discovered. This is to prevent spammy events before sending 136 // already been discovered. This is to prevent spammy events before sending
194 // out the first Gatt 137 // out the first Gatt
195 if (!discovery_complete_) 138 if (!discovery_complete_)
196 return; 139 return;
197 140
198 DCHECK(adapter_); 141 DCHECK(GetAdapter());
199 adapter_->NotifyGattServiceChanged(this); 142 GetAdapter()->NotifyGattServiceChanged(this);
200 } 143 }
201 144
202 void BluetoothRemoteGattServiceBlueZ::NotifyDescriptorAddedOrRemoved( 145 void BluetoothRemoteGattServiceBlueZ::NotifyDescriptorAddedOrRemoved(
203 BluetoothRemoteGattCharacteristicBlueZ* characteristic, 146 BluetoothRemoteGattCharacteristicBlueZ* characteristic,
204 BluetoothRemoteGattDescriptorBlueZ* descriptor, 147 BluetoothGattDescriptorBlueZ* descriptor,
205 bool added) { 148 bool added) {
206 DCHECK(characteristic->GetService() == this); 149 DCHECK(characteristic->GetService() == this);
207 DCHECK(descriptor->GetCharacteristic() == characteristic); 150 DCHECK(descriptor->GetCharacteristic() == characteristic);
208 DCHECK(adapter_); 151 DCHECK(GetAdapter());
209 152
210 if (added) { 153 if (added) {
211 adapter_->NotifyGattDescriptorAdded(descriptor); 154 GetAdapter()->NotifyGattDescriptorAdded(descriptor);
212 return; 155 return;
213 } 156 }
214 157
215 adapter_->NotifyGattDescriptorRemoved(descriptor); 158 GetAdapter()->NotifyGattDescriptorRemoved(descriptor);
216 } 159 }
217 160
218 void BluetoothRemoteGattServiceBlueZ::NotifyDescriptorValueChanged( 161 void BluetoothRemoteGattServiceBlueZ::NotifyDescriptorValueChanged(
219 BluetoothRemoteGattCharacteristicBlueZ* characteristic, 162 BluetoothRemoteGattCharacteristicBlueZ* characteristic,
220 BluetoothRemoteGattDescriptorBlueZ* descriptor, 163 BluetoothGattDescriptorBlueZ* descriptor,
221 const std::vector<uint8_t>& value) { 164 const std::vector<uint8_t>& value) {
222 DCHECK(characteristic->GetService() == this); 165 DCHECK(characteristic->GetService() == this);
223 DCHECK(descriptor->GetCharacteristic() == characteristic); 166 DCHECK(descriptor->GetCharacteristic() == characteristic);
224 DCHECK(adapter_); 167 DCHECK(GetAdapter());
225 adapter_->NotifyGattDescriptorValueChanged(descriptor, value); 168 GetAdapter()->NotifyGattDescriptorValueChanged(descriptor, value);
226 } 169 }
227 170
228 void BluetoothRemoteGattServiceBlueZ::GattServicePropertyChanged( 171 void BluetoothRemoteGattServiceBlueZ::GattServicePropertyChanged(
229 const dbus::ObjectPath& object_path, 172 const dbus::ObjectPath& object_path,
230 const std::string& property_name) { 173 const std::string& property_name) {
231 if (object_path != object_path_) 174 if (object_path != this->object_path())
232 return; 175 return;
233 176
234 VLOG(1) << "Service property changed: \"" << property_name << "\", " 177 VLOG(1) << "Service property changed: \"" << property_name << "\", "
235 << object_path.value(); 178 << object_path.value();
236 bluez::BluetoothGattServiceClient::Properties* properties = 179 bluez::BluetoothGattServiceClient::Properties* properties =
237 bluez::BluezDBusManager::Get() 180 bluez::BluezDBusManager::Get()
238 ->GetBluetoothGattServiceClient() 181 ->GetBluetoothGattServiceClient()
239 ->GetProperties(object_path); 182 ->GetProperties(object_path);
240 DCHECK(properties); 183 DCHECK(properties);
241 184
242 if (property_name != properties->characteristics.name()) { 185 if (property_name != properties->characteristics.name()) {
243 NotifyServiceChanged(); 186 NotifyServiceChanged();
244 return; 187 return;
245 } 188 }
246 189
247 if (discovery_complete_) 190 if (discovery_complete_)
248 return; 191 return;
249 192
250 VLOG(1) << "All characteristics were discovered for service: " 193 VLOG(1) << "All characteristics were discovered for service: "
251 << object_path.value(); 194 << object_path.value();
252 discovery_complete_ = true; 195 discovery_complete_ = true;
253 DCHECK(adapter_); 196 DCHECK(GetAdapter());
254 adapter_->NotifyGattDiscoveryComplete(this); 197 GetAdapter()->NotifyGattDiscoveryComplete(this);
255 } 198 }
256 199
257 void BluetoothRemoteGattServiceBlueZ::GattCharacteristicAdded( 200 void BluetoothRemoteGattServiceBlueZ::GattCharacteristicAdded(
258 const dbus::ObjectPath& object_path) { 201 const dbus::ObjectPath& object_path) {
259 if (characteristics_.find(object_path) != characteristics_.end()) { 202 if (characteristics_.find(object_path) != characteristics_.end()) {
260 VLOG(1) << "Remote GATT characteristic already exists: " 203 VLOG(1) << "Remote GATT characteristic already exists: "
261 << object_path.value(); 204 << object_path.value();
262 return; 205 return;
263 } 206 }
264 207
265 bluez::BluetoothGattCharacteristicClient::Properties* properties = 208 bluez::BluetoothGattCharacteristicClient::Properties* properties =
266 bluez::BluezDBusManager::Get() 209 bluez::BluezDBusManager::Get()
267 ->GetBluetoothGattCharacteristicClient() 210 ->GetBluetoothGattCharacteristicClient()
268 ->GetProperties(object_path); 211 ->GetProperties(object_path);
269 DCHECK(properties); 212 DCHECK(properties);
270 if (properties->service.value() != object_path_) { 213 if (properties->service.value() != this->object_path()) {
271 VLOG(2) << "Remote GATT characteristic does not belong to this service."; 214 VLOG(2) << "Remote GATT characteristic does not belong to this service.";
272 return; 215 return;
273 } 216 }
274 217
275 VLOG(1) << "Adding new remote GATT characteristic for GATT service: " 218 VLOG(1) << "Adding new remote GATT characteristic for GATT service: "
276 << GetIdentifier() << ", UUID: " << GetUUID().canonical_value(); 219 << GetIdentifier() << ", UUID: " << GetUUID().canonical_value();
277 220
278 BluetoothRemoteGattCharacteristicBlueZ* characteristic = 221 BluetoothRemoteGattCharacteristicBlueZ* characteristic =
279 new BluetoothRemoteGattCharacteristicBlueZ(this, object_path); 222 new BluetoothRemoteGattCharacteristicBlueZ(this, object_path);
280 characteristics_[object_path] = characteristic; 223 characteristics_[object_path] = characteristic;
281 DCHECK(characteristic->GetIdentifier() == object_path.value()); 224 DCHECK(characteristic->GetIdentifier() == object_path.value());
282 DCHECK(characteristic->GetUUID().IsValid()); 225 DCHECK(characteristic->GetUUID().IsValid());
283 226
284 DCHECK(adapter_); 227 DCHECK(GetAdapter());
285 adapter_->NotifyGattCharacteristicAdded(characteristic); 228 GetAdapter()->NotifyGattCharacteristicAdded(characteristic);
286 } 229 }
287 230
288 void BluetoothRemoteGattServiceBlueZ::GattCharacteristicRemoved( 231 void BluetoothRemoteGattServiceBlueZ::GattCharacteristicRemoved(
289 const dbus::ObjectPath& object_path) { 232 const dbus::ObjectPath& object_path) {
290 CharacteristicMap::iterator iter = characteristics_.find(object_path); 233 CharacteristicMap::iterator iter = characteristics_.find(object_path);
291 if (iter == characteristics_.end()) { 234 if (iter == characteristics_.end()) {
292 VLOG(2) << "Unknown GATT characteristic removed: " << object_path.value(); 235 VLOG(2) << "Unknown GATT characteristic removed: " << object_path.value();
293 return; 236 return;
294 } 237 }
295 238
296 VLOG(1) << "Removing remote GATT characteristic from service: " 239 VLOG(1) << "Removing remote GATT characteristic from service: "
297 << GetIdentifier() << ", UUID: " << GetUUID().canonical_value(); 240 << GetIdentifier() << ", UUID: " << GetUUID().canonical_value();
298 241
299 BluetoothRemoteGattCharacteristicBlueZ* characteristic = iter->second; 242 BluetoothRemoteGattCharacteristicBlueZ* characteristic = iter->second;
300 DCHECK(characteristic->object_path() == object_path); 243 DCHECK(characteristic->object_path() == object_path);
301 characteristics_.erase(iter); 244 characteristics_.erase(iter);
302 245
303 DCHECK(adapter_); 246 DCHECK(GetAdapter());
304 adapter_->NotifyGattCharacteristicRemoved(characteristic); 247 GetAdapter()->NotifyGattCharacteristicRemoved(characteristic);
305 248
306 delete characteristic; 249 delete characteristic;
307 } 250 }
308 251
309 void BluetoothRemoteGattServiceBlueZ::GattCharacteristicPropertyChanged( 252 void BluetoothRemoteGattServiceBlueZ::GattCharacteristicPropertyChanged(
310 const dbus::ObjectPath& object_path, 253 const dbus::ObjectPath& object_path,
311 const std::string& property_name) { 254 const std::string& property_name) {
312 CharacteristicMap::iterator iter = characteristics_.find(object_path); 255 CharacteristicMap::iterator iter = characteristics_.find(object_path);
313 if (iter == characteristics_.end()) { 256 if (iter == characteristics_.end()) {
314 VLOG(3) << "Properties of unknown characteristic changed"; 257 VLOG(3) << "Properties of unknown characteristic changed";
315 return; 258 return;
316 } 259 }
317 260
318 // We may receive a property changed event in certain cases, e.g. when the 261 // We may receive a property changed event in certain cases, e.g. when the
319 // characteristic "Flags" property has been updated with values from the 262 // characteristic "Flags" property has been updated with values from the
320 // "Characteristic Extended Properties" descriptor. In this case, kick off 263 // "Characteristic Extended Properties" descriptor. In this case, kick off
321 // a service changed observer event to let observers refresh the 264 // a service changed observer event to let observers refresh the
322 // characteristics. 265 // characteristics.
323 bluez::BluetoothGattCharacteristicClient::Properties* properties = 266 bluez::BluetoothGattCharacteristicClient::Properties* properties =
324 bluez::BluezDBusManager::Get() 267 bluez::BluezDBusManager::Get()
325 ->GetBluetoothGattCharacteristicClient() 268 ->GetBluetoothGattCharacteristicClient()
326 ->GetProperties(object_path); 269 ->GetProperties(object_path);
327 270
328 DCHECK(properties); 271 DCHECK(properties);
329 DCHECK(adapter_); 272 DCHECK(GetAdapter());
330 273
331 if (property_name == properties->flags.name()) 274 if (property_name == properties->flags.name())
332 NotifyServiceChanged(); 275 NotifyServiceChanged();
333 else if (property_name == properties->value.name()) 276 else if (property_name == properties->value.name())
334 adapter_->NotifyGattCharacteristicValueChanged(iter->second, 277 GetAdapter()->NotifyGattCharacteristicValueChanged(
335 properties->value.value()); 278 iter->second, properties->value.value());
336 } 279 }
337 280
338 } // namespace bluez 281 } // namespace bluez
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698