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

Unified Diff: device/bluetooth/bluetooth_low_energy_discovery_manager_mac.h

Issue 1165053003: Adding support for Low Energy device discovery to BluetoothAdapterMac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removing references to CBCentralManager Created 5 years, 6 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_low_energy_discovery_manager_mac.h
diff --git a/device/bluetooth/bluetooth_low_energy_discovery_manager_mac.h b/device/bluetooth/bluetooth_low_energy_discovery_manager_mac.h
index 29ad5297e623b95d13fa0fa50a994d372715517c..2cb5c0aa3f53b424aa9cac7bece1cc7196910549 100644
--- a/device/bluetooth/bluetooth_low_energy_discovery_manager_mac.h
+++ b/device/bluetooth/bluetooth_low_energy_discovery_manager_mac.h
@@ -28,11 +28,10 @@ class BluetoothLowEnergyDiscoveryManagerMac {
// Interface for being notified of events during a device discovery session.
class Observer {
public:
- // Called when |this| manager has found a device.
- virtual void DeviceFound(BluetoothLowEnergyDeviceMac* device) = 0;
-
- // Called when |this| manager has updated on a device.
- virtual void DeviceUpdated(BluetoothLowEnergyDeviceMac* device) = 0;
+ // Called when |this| manager has found a device or an update on a device.
+ virtual void LowEnergyDeviceUpdated(CBPeripheral* peripheral,
+ NSDictionary* advertisementData,
+ int rssi) = 0;
protected:
virtual ~Observer() {}
@@ -69,9 +68,13 @@ class BluetoothLowEnergyDiscoveryManagerMac {
private:
explicit BluetoothLowEnergyDiscoveryManagerMac(Observer* observer);
- void ClearDevices();
+
+ // Private method for testing. Resets |manager_| to |manager| and set
+ // |bridge_| as its delegate.
+ virtual void SetManager(CBCentralManager* manager);
scheib 2015/06/17 16:55:08 If it is only called in tests, rename to SetManage
krstnmnlsn 2015/06/17 20:18:41 Done.
friend class BluetoothLowEnergyDiscoveryManagerMacDelegate;
+ friend class BluetoothAdapterMacTest;
// Observer interested in notifications from us.
Observer* observer_;
@@ -89,9 +92,6 @@ class BluetoothLowEnergyDiscoveryManagerMac {
// Delegate of the central manager.
base::scoped_nsobject<BluetoothLowEnergyDiscoveryManagerMacBridge> bridge_;
- // Map of the device identifiers to the discovered device.
- std::map<const std::string, BluetoothLowEnergyDeviceMac*> devices_;
-
// List of service UUIDs to scan.
BluetoothDevice::UUIDList services_uuids_;

Powered by Google App Engine
This is Rietveld 408576698