| OLD | NEW |
| 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 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 // hash the probability of this occuring with 10,000 devices | 486 // hash the probability of this occuring with 10,000 devices |
| 487 // simultaneously present is 1e-6 (see | 487 // simultaneously present is 1e-6 (see |
| 488 // https://en.wikipedia.org/wiki/Birthday_problem#Probability_table). We | 488 // https://en.wikipedia.org/wiki/Birthday_problem#Probability_table). We |
| 489 // ignore the second device by returning. | 489 // ignore the second device by returning. |
| 490 return; | 490 return; |
| 491 } | 491 } |
| 492 | 492 |
| 493 // A device has an update. | 493 // A device has an update. |
| 494 VLOG(2) << "LowEnergyDeviceUpdated"; | 494 VLOG(2) << "LowEnergyDeviceUpdated"; |
| 495 device_mac->Update(peripheral, advertisement_data, rssi); | 495 device_mac->Update(peripheral, advertisement_data, rssi); |
| 496 // TODO(scheib): Call DeviceChanged only if UUIDs change. crbug.com/547106 |
| 496 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, | 497 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, |
| 497 DeviceChanged(this, device_mac)); | 498 DeviceChanged(this, device_mac)); |
| 498 } | 499 } |
| 499 | 500 |
| 500 // TODO(krstnmnlsn): Implement. crbug.com/511025 | 501 // TODO(krstnmnlsn): Implement. crbug.com/511025 |
| 501 void BluetoothAdapterMac::LowEnergyCentralManagerUpdatedState() {} | 502 void BluetoothAdapterMac::LowEnergyCentralManagerUpdatedState() {} |
| 502 | 503 |
| 503 void BluetoothAdapterMac::RemoveTimedOutDevices() { | 504 void BluetoothAdapterMac::RemoveTimedOutDevices() { |
| 504 // Notify observers if any previously seen devices are no longer available, | 505 // Notify observers if any previously seen devices are no longer available, |
| 505 // i.e. if they are no longer paired, connected, nor recently discovered via | 506 // i.e. if they are no longer paired, connected, nor recently discovered via |
| (...skipping 23 matching lines...) Expand all Loading... |
| 529 } | 530 } |
| 530 | 531 |
| 531 void BluetoothAdapterMac::AddPairedDevices() { | 532 void BluetoothAdapterMac::AddPairedDevices() { |
| 532 // Add any new paired devices. | 533 // Add any new paired devices. |
| 533 for (IOBluetoothDevice* device in [IOBluetoothDevice pairedDevices]) { | 534 for (IOBluetoothDevice* device in [IOBluetoothDevice pairedDevices]) { |
| 534 ClassicDeviceAdded(device); | 535 ClassicDeviceAdded(device); |
| 535 } | 536 } |
| 536 } | 537 } |
| 537 | 538 |
| 538 } // namespace device | 539 } // namespace device |
| OLD | NEW |