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

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

Issue 1414553004: bluetooth: android: Accumulate advertised UUIDs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bt-i541710-
Patch Set: Fix armansito request, and only report update if UUIDs changed. Created 5 years, 2 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 9
10 #include <string> 10 #include <string>
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698