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

Unified Diff: device/bluetooth/bluetooth_low_energy_win_fake.cc

Issue 1681853003: Add BluetoothRemoteGattServiceWin to BluetoothDeviceWin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add PlatformSupportsLowEnergy check in the unittests Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/bluetooth_low_energy_win_fake.cc
diff --git a/device/bluetooth/bluetooth_low_energy_win_fake.cc b/device/bluetooth/bluetooth_low_energy_win_fake.cc
index 6db6444d8e38ca625b2e01f063cf0625670b6b43..67503238f2f2cdd47b297ddd68112fb64835883e 100644
--- a/device/bluetooth/bluetooth_low_energy_win_fake.cc
+++ b/device/bluetooth/bluetooth_low_energy_win_fake.cc
@@ -152,6 +152,14 @@ BLEGattService* BluetoothLowEnergyWrapperFake::SimulateBLEGattService(
return service;
}
+BLEDevice* BluetoothLowEnergyWrapperFake::GetSimulatedBLEDevice(
+ std::string device_address) {
+ BLEDevicesMap::iterator it_d = simulated_devices_.find(device_address);
+ if (it_d == simulated_devices_.end())
+ return nullptr;
+ return it_d->second.get();
+}
+
USHORT BluetoothLowEnergyWrapperFake::GenerateAUniqueAttributeHandle(
std::string device_address) {
scoped_ptr<std::set<USHORT>>& set_of_ushort =
@@ -200,7 +208,7 @@ BluetoothLowEnergyWrapperFake::ExtractDeviceAddressFromDevicePath(
base::string16 path) {
std::size_t found = path.find('/');
if (found != base::string16::npos) {
- return path.substr(0, found - 1);
+ return path.substr(0, found);
}
return path;
}
« no previous file with comments | « device/bluetooth/bluetooth_low_energy_win_fake.h ('k') | device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698