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

Side by Side Diff: device/bluetooth/dbus/fake_bluetooth_device_client.cc

Issue 1847823002: bluetooth: replace gattservices dbus property with servicesresolved (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
« no previous file with comments | « device/bluetooth/dbus/bluetooth_device_client.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/dbus/fake_bluetooth_device_client.h" 5 #include "device/bluetooth/dbus/fake_bluetooth_device_client.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <sys/socket.h> 9 #include <sys/socket.h>
10 #include <sys/types.h> 10 #include <sys/types.h>
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 "Connection fails while paired"); 380 "Connection fails while paired");
381 return; 381 return;
382 } 382 }
383 383
384 // The device can be connected. 384 // The device can be connected.
385 properties->connected.ReplaceValue(true); 385 properties->connected.ReplaceValue(true);
386 callback.Run(); 386 callback.Run();
387 387
388 // Expose GATT services if connected to LE device. 388 // Expose GATT services if connected to LE device.
389 if (object_path == dbus::ObjectPath(kLowEnergyPath)) { 389 if (object_path == dbus::ObjectPath(kLowEnergyPath)) {
390 FakeBluetoothGattServiceClient* gatt_service_client = 390 properties->services_resolved.ReplaceValue(true);
391 static_cast<FakeBluetoothGattServiceClient*>(
392 bluez::BluezDBusManager::Get()->GetBluetoothGattServiceClient());
393 gatt_service_client->ExposeHeartRateService(
394 dbus::ObjectPath(kLowEnergyPath));
395 properties->gatt_services.ReplaceValue(gatt_service_client->GetServices());
396 } 391 }
397 392
398 AddInputDeviceIfNeeded(object_path, properties); 393 AddInputDeviceIfNeeded(object_path, properties);
399 } 394 }
400 395
401 void FakeBluetoothDeviceClient::Disconnect( 396 void FakeBluetoothDeviceClient::Disconnect(
402 const dbus::ObjectPath& object_path, 397 const dbus::ObjectPath& object_path,
403 const base::Closure& callback, 398 const base::Closure& callback,
404 const ErrorCallback& error_callback) { 399 const ErrorCallback& error_callback) {
405 VLOG(1) << "Disconnect: " << object_path.value(); 400 VLOG(1) << "Disconnect: " << object_path.value();
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1662 // TODO(keybuk): tear down this side of the connection 1657 // TODO(keybuk): tear down this side of the connection
1663 callback.Run(); 1658 callback.Run();
1664 } else if (status == BluetoothProfileServiceProvider::Delegate::CANCELLED) { 1659 } else if (status == BluetoothProfileServiceProvider::Delegate::CANCELLED) {
1665 error_callback.Run(bluetooth_device::kErrorFailed, "Canceled"); 1660 error_callback.Run(bluetooth_device::kErrorFailed, "Canceled");
1666 } else if (status == BluetoothProfileServiceProvider::Delegate::REJECTED) { 1661 } else if (status == BluetoothProfileServiceProvider::Delegate::REJECTED) {
1667 error_callback.Run(bluetooth_device::kErrorFailed, "Rejected"); 1662 error_callback.Run(bluetooth_device::kErrorFailed, "Rejected");
1668 } 1663 }
1669 } 1664 }
1670 1665
1671 } // namespace bluez 1666 } // namespace bluez
OLDNEW
« no previous file with comments | « device/bluetooth/dbus/bluetooth_device_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698