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

Unified Diff: device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm

Issue 2339253002: bluetooth: mac: add connected LE devices to chooser (Closed)
Patch Set: 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 eeb1ace3beb1996e17dc2abb39103a7ffc787899..70cece66244dc5197c4c2f70b60d6d532e31148c 100644
--- a/device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm
+++ b/device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm
@@ -73,6 +73,21 @@ void BluetoothLowEnergyDiscoveryManagerMac::TryStartDiscovery() {
CBCentralManagerScanOptionAllowDuplicatesKey :
@YES
}];
+ NSArray* connectedServices;
+ if (services) {
+ connectedServices = services;
+ } else {
+ CBUUID* defaultService = [CBUUID UUIDWithString:@"1800"];
François Beaufort 2016/09/15 07:38:16 You may want to add a comment there to explain why
jlebel 2016/09/21 13:49:28 Done.
+ connectedServices = @[ defaultService ];
+ }
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpartial-availability"
François Beaufort 2016/09/15 07:38:16 According to https://developer.apple.com/reference
jlebel 2016/09/21 13:49:28 I think it is a terrible idea to create a fake dec
+ NSArray* peripherals = [central_manager_
+ retrieveConnectedPeripheralsWithServices:connectedServices];
+#pragma clang diagnostic pop
+ for (CBPeripheral* peripheral in peripherals) {
+ observer_->LowEnergyDeviceUpdated(peripheral, nil, 0);
François Beaufort 2016/09/15 07:38:16 Nit: observer_->LowEnergyDeviceUpdated(peripheral
jlebel 2016/09/21 13:49:28 Done.
+ }
pending_ = false;
}
« no previous file with comments | « device/bluetooth/bluetooth_low_energy_discovery_manager_mac.h ('k') | device/bluetooth/test/bluetooth_test_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698