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

Unified Diff: device/bluetooth/bluetooth_adapter_mac.mm

Issue 2854733002: bluetooth: macOS: BluetoothLowEnergyDeviceMac::IsConnectable() not implemented (Closed)
Patch Set: Adding unittests and implementation Created 3 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 side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/bluetooth_adapter_mac.mm
diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
index cda597deee6aa0aaa1df0e0acdce78eeeb35af77..4340c7e46ad6163741548a4474a7219c32fc0e95 100644
--- a/device/bluetooth/bluetooth_adapter_mac.mm
+++ b/device/bluetooth/bluetooth_adapter_mac.mm
@@ -530,7 +530,9 @@ void BluetoothAdapterMac::LowEnergyDeviceUpdated(
const bool is_new_device = device_mac == nullptr;
if (is_new_device) {
// A new device has been found.
- device_mac = new BluetoothLowEnergyDeviceMac(this, peripheral);
+ bool connectable =
+ [advertisement_data[CBAdvertisementDataIsConnectable] boolValue];
+ device_mac = new BluetoothLowEnergyDeviceMac(this, peripheral, connectable);
VLOG(1) << *device_mac << ": New Device.";
} else if (DoesCollideWithKnownDevice(peripheral, device_mac)) {
return;
@@ -635,7 +637,7 @@ BluetoothAdapterMac::RetrieveGattConnectedDevicesWithService(
continue;
}
if (is_new_device) {
- device_mac = new BluetoothLowEnergyDeviceMac(this, peripheral);
+ device_mac = new BluetoothLowEnergyDeviceMac(this, peripheral, true);
std::string device_address =
BluetoothLowEnergyDeviceMac::GetPeripheralHashAddress(peripheral);
devices_[device_address] = base::WrapUnique(device_mac);
« no previous file with comments | « no previous file | device/bluetooth/bluetooth_adapter_unittest.cc » ('j') | device/bluetooth/bluetooth_low_energy_device_mac.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698