Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DISCOVERY_MANAGER_MAC_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DISCOVERY_MANAGER_MAC_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DISCOVERY_MANAGER_MAC_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DISCOVERY_MANAGER_MAC_H_ |
| 7 | 7 |
| 8 #if defined(OS_IOS) | 8 #if defined(OS_IOS) |
| 9 #import <CoreBluetooth/CoreBluetooth.h> | 9 #import <CoreBluetooth/CoreBluetooth.h> |
| 10 #else | 10 #else |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 virtual ~BluetoothLowEnergyDiscoveryManagerMac(); | 37 virtual ~BluetoothLowEnergyDiscoveryManagerMac(); |
| 38 | 38 |
| 39 // Returns true, if discovery is currently being performed. | 39 // Returns true, if discovery is currently being performed. |
| 40 virtual bool IsDiscovering() const; | 40 virtual bool IsDiscovering() const; |
| 41 | 41 |
| 42 // Initiates a discovery session. | 42 // Initiates a discovery session. |
| 43 // BluetoothLowEnergyDeviceMac objects discovered within a previous | 43 // BluetoothLowEnergyDeviceMac objects discovered within a previous |
| 44 // discovery session will be invalid. | 44 // discovery session will be invalid. |
| 45 virtual void StartDiscovery(BluetoothDevice::UUIDList services_uuids); | 45 virtual void StartDiscovery(std::set<BluetoothUUID> services_uuids); |
| 46 | |
| 47 // Updates the scan request to stop scanning for |uuids_to_remove| if | |
| 48 // no other filter is scanning for those uuids. | |
|
Jeffrey Yasskin
2016/08/23 21:37:04
We don't have the concept of a filter in this clas
| |
| 49 virtual void RemoveDiscoveryUUIDs(std::set<BluetoothUUID> uuids_to_remove); | |
| 46 | 50 |
| 47 // Stops a discovery session. | 51 // Stops a discovery session. |
| 48 virtual void StopDiscovery(); | 52 virtual void StopDiscovery(); |
| 49 | 53 |
| 50 // Returns a new BluetoothLowEnergyDiscoveryManagerMac. | 54 // Returns a new BluetoothLowEnergyDiscoveryManagerMac. |
| 51 static BluetoothLowEnergyDiscoveryManagerMac* Create(Observer* observer); | 55 static BluetoothLowEnergyDiscoveryManagerMac* Create(Observer* observer); |
| 52 | 56 |
| 53 virtual void SetCentralManager(CBCentralManager* central_manager); | 57 virtual void SetCentralManager(CBCentralManager* central_manager); |
| 54 | 58 |
| 55 protected: | 59 protected: |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 77 // Underlying CoreBluetooth central manager, owned by |observer_|. | 81 // Underlying CoreBluetooth central manager, owned by |observer_|. |
| 78 CBCentralManager* central_manager_ = nil; | 82 CBCentralManager* central_manager_ = nil; |
| 79 | 83 |
| 80 // Discovery has been initiated by calling the API StartDiscovery(). | 84 // Discovery has been initiated by calling the API StartDiscovery(). |
| 81 bool discovering_; | 85 bool discovering_; |
| 82 | 86 |
| 83 // A discovery has been initiated but has not started yet because it's | 87 // A discovery has been initiated but has not started yet because it's |
| 84 // waiting for Bluetooth to turn on. | 88 // waiting for Bluetooth to turn on. |
| 85 bool pending_; | 89 bool pending_; |
| 86 | 90 |
| 87 // List of service UUIDs to scan. | 91 // List of service UUIDs to scan for to the number of filters that have that |
|
Jeffrey Yasskin
2016/08/23 21:37:04
s/list/map/?
| |
| 88 BluetoothDevice::UUIDList services_uuids_; | 92 // UUID. |
| 93 std::unordered_map<device::BluetoothUUID, size_t, device::BluetoothUUIDHash> | |
| 94 scan_uuids_to_filter_count_; | |
| 89 | 95 |
| 90 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyDiscoveryManagerMac); | 96 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyDiscoveryManagerMac); |
| 91 }; | 97 }; |
| 92 | 98 |
| 93 } // namespace device | 99 } // namespace device |
| 94 | 100 |
| 95 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DISCOVERY_MANAGER_MAC_H_ | 101 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DISCOVERY_MANAGER_MAC_H_ |
| OLD | NEW |