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

Unified Diff: device/bluetooth/dbus/fake_bluetooth_device_client.cc

Issue 2483783005: bluetooth: bluez: Implement RetrieveGattConnectedDevicesWithDiscoveryFilter (Closed)
Patch Set: Clean up Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/dbus/fake_bluetooth_device_client.cc
diff --git a/device/bluetooth/dbus/fake_bluetooth_device_client.cc b/device/bluetooth/dbus/fake_bluetooth_device_client.cc
index 4b5395ae7af2d4bdcb7772c6f867a383c37a9c40..5aaaf085333a4006349fc1bfbc40a5c722b7a1f4 100644
--- a/device/bluetooth/dbus/fake_bluetooth_device_client.cc
+++ b/device/bluetooth/dbus/fake_bluetooth_device_client.cc
@@ -236,6 +236,11 @@ const char FakeBluetoothDeviceClient::kLowEnergyName[] =
const uint32_t FakeBluetoothDeviceClient::kLowEnergyClass =
0x000918; // Major class "Health", Minor class "Heart/Pulse Rate Monitor."
+const char FakeBluetoothDeviceClient::kDualPath[] = "/fake/hci0/devF";
+const char FakeBluetoothDeviceClient::kDualAddress[] = "00:1A:11:00:15:40";
+const char FakeBluetoothDeviceClient::kDualName[] =
+ "Bluetooth 4.0 Battery Monitor";
+
const char FakeBluetoothDeviceClient::kPairedUnconnectableDevicePath[] =
"/fake/hci0/devD";
const char FakeBluetoothDeviceClient::kPairedUnconnectableDeviceAddress[] =
@@ -746,10 +751,17 @@ void FakeBluetoothDeviceClient::CreateDevice(
properties->name.set_valid(true);
properties->services_resolved.ReplaceValue(false);
properties->type.ReplaceValue(BluetoothDeviceClient::kTypeLe);
-
- std::vector<std::string> uuids;
- uuids.push_back(FakeBluetoothGattServiceClient::kHeartRateServiceUUID);
- properties->uuids.ReplaceValue(uuids);
+ properties->uuids.ReplaceValue(std::vector<std::string>(
+ {FakeBluetoothGattServiceClient::kHeartRateServiceUUID}));
+ } else if (device_path == dbus::ObjectPath(kDualPath)) {
+ properties->address.ReplaceValue(kDualAddress);
+ properties->name.ReplaceValue(kDualName);
+ properties->name.set_valid(true);
+ properties->services_resolved.ReplaceValue(false);
+ properties->type.ReplaceValue(BluetoothDeviceClient::kTypeDual);
+ properties->uuids.ReplaceValue(std::vector<std::string>(
+ {FakeBluetoothGattServiceClient::kGenericAccessServiceUUID,
+ FakeBluetoothGattServiceClient::kHeartRateServiceUUID}));
} else if (device_path ==
dbus::ObjectPath(kConnectedTrustedNotPairedDevicePath)) {
properties->address.ReplaceValue(kConnectedTrustedNotPairedDeviceAddress);
« no previous file with comments | « device/bluetooth/dbus/fake_bluetooth_device_client.h ('k') | device/bluetooth/dbus/fake_bluetooth_gatt_service_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698