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

Side by Side Diff: device/bluetooth/bluetooth_adapter_mac.mm

Issue 2205693003: bluetooth: Replace old advertised uuids (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Fix mac Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/bluetooth/bluetooth_adapter_mac.h" 5 #include "device/bluetooth/bluetooth_adapter_mac.h"
6 6
7 #import <IOBluetooth/objc/IOBluetoothDevice.h> 7 #import <IOBluetooth/objc/IOBluetoothDevice.h>
8 #import <IOBluetooth/objc/IOBluetoothHostController.h> 8 #import <IOBluetooth/objc/IOBluetoothHostController.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 // hash the probability of this occuring with 10,000 devices 508 // hash the probability of this occuring with 10,000 devices
509 // simultaneously present is 1e-6 (see 509 // simultaneously present is 1e-6 (see
510 // https://en.wikipedia.org/wiki/Birthday_problem#Probability_table). We 510 // https://en.wikipedia.org/wiki/Birthday_problem#Probability_table). We
511 // ignore the second device by returning. 511 // ignore the second device by returning.
512 return; 512 return;
513 } 513 }
514 514
515 // A device has an update. 515 // A device has an update.
516 VLOG(2) << "LowEnergyDeviceUpdated"; 516 VLOG(2) << "LowEnergyDeviceUpdated";
517 device_mac->Update(advertisement_data, rssi); 517 device_mac->Update(advertisement_data, rssi);
518 // TODO(scheib): Call DeviceChanged only if UUIDs change. crbug.com/547106 518
519 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, 519 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
scheib 2016/08/05 18:49:31 Why dropping the comment?
ortuno 2016/08/05 23:00:16 See response on bluetooth_adapter_android.
520 DeviceChanged(this, device_mac)); 520 DeviceChanged(this, device_mac));
521 } 521 }
522 522
523 // TODO(krstnmnlsn): Implement. crbug.com/511025 523 // TODO(krstnmnlsn): Implement. crbug.com/511025
524 void BluetoothAdapterMac::LowEnergyCentralManagerUpdatedState() {} 524 void BluetoothAdapterMac::LowEnergyCentralManagerUpdatedState() {}
525 525
526 void BluetoothAdapterMac::AddPairedDevices() { 526 void BluetoothAdapterMac::AddPairedDevices() {
527 // Add any new paired devices. 527 // Add any new paired devices.
528 for (IOBluetoothDevice* device in [IOBluetoothDevice pairedDevices]) { 528 for (IOBluetoothDevice* device in [IOBluetoothDevice pairedDevices]) {
529 ClassicDeviceAdded(device); 529 ClassicDeviceAdded(device);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 std::string device_address = 591 std::string device_address =
592 BluetoothLowEnergyDeviceMac::GetPeripheralHashAddress(peripheral); 592 BluetoothLowEnergyDeviceMac::GetPeripheralHashAddress(peripheral);
593 DevicesMap::const_iterator iter = devices_.find(device_address); 593 DevicesMap::const_iterator iter = devices_.find(device_address);
594 if (iter == devices_.end()) { 594 if (iter == devices_.end()) {
595 return nil; 595 return nil;
596 } 596 }
597 return static_cast<BluetoothLowEnergyDeviceMac*>(iter->second); 597 return static_cast<BluetoothLowEnergyDeviceMac*>(iter->second);
598 } 598 }
599 599
600 } // namespace device 600 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698