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

Unified Diff: device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm

Issue 2339253002: bluetooth: mac: add connected LE devices to chooser (Closed)
Patch Set: Adding BluetoothAdapter::RetrievedConnectedPeripherals() and the implementation in BluetoothAdapter… Created 4 years, 3 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_discovery_manager_mac.mm
diff --git a/device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm b/device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm
index f4f13ee9922fedb768dd34ad7b07337987f99484..e7c42a9eb1d85b5002b45173934877893fec606d 100644
--- a/device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm
+++ b/device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm
@@ -23,10 +23,10 @@ bool BluetoothLowEnergyDiscoveryManagerMac::IsDiscovering() const {
}
void BluetoothLowEnergyDiscoveryManagerMac::StartDiscovery(
- BluetoothDevice::UUIDList services_uuids) {
+ NSArray* services_uuids) {
discovering_ = true;
pending_ = true;
- services_uuids_ = services_uuids;
+ services_uuids_.reset(services_uuids, base::scoped_policy::RETAIN);
TryStartDiscovery();
}
@@ -51,24 +51,12 @@ void BluetoothLowEnergyDiscoveryManagerMac::TryStartDiscovery() {
return;
}
- // Converts the services UUIDs to a CoreBluetooth data structure.
- NSMutableArray* services = nil;
- if (!services_uuids_.empty()) {
- services = [NSMutableArray array];
- for (auto& service_uuid : services_uuids_) {
- NSString* uuidString =
- base::SysUTF8ToNSString(service_uuid.canonical_value().c_str());
- CBUUID* uuid = [CBUUID UUIDWithString:uuidString];
- [services addObject:uuid];
- }
- };
-
VLOG(1) << "TryStartDiscovery scanForPeripheralsWithServices";
// Start a scan with the Allow Duplicates option so that we get notified
// of each new Advertisement Packet. This allows us to provide up to date
// values for RSSI, Advertised Services, Advertised Data, etc.
[central_manager_
- scanForPeripheralsWithServices:services
+ scanForPeripheralsWithServices:services_uuids_
ortuno 2016/09/28 23:15:52 This seems unrelated. Please do in another patch.
jlebel 2016/10/05 14:09:41 Done.
options:@{
CBCentralManagerScanOptionAllowDuplicatesKey :
@YES

Powered by Google App Engine
This is Rietveld 408576698