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

Unified Diff: device/bluetooth/bluetooth_adapter_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: 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_adapter_mac.h
diff --git a/device/bluetooth/bluetooth_adapter_mac.h b/device/bluetooth/bluetooth_adapter_mac.h
index 08c4fb5e7786cb5671782ed04555aa09316ce01e..e48ca759050014022644cd810bc67fbd39b09f4e 100644
--- a/device/bluetooth/bluetooth_adapter_mac.h
+++ b/device/bluetooth/bluetooth_adapter_mac.h
@@ -19,6 +19,8 @@
#include "device/bluetooth/bluetooth_audio_sink.h"
#include "device/bluetooth/bluetooth_discovery_manager_mac.h"
#include "device/bluetooth/bluetooth_export.h"
+#include "device/bluetooth/bluetooth_low_energy_device_mac.h"
+#include "device/bluetooth/bluetooth_low_energy_discovery_manager_mac.h"
@class IOBluetoothDevice;
@class NSArray;
@@ -36,11 +38,12 @@ class BluetoothAdapterMacTest;
class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterMac
: public BluetoothAdapter,
- public BluetoothDiscoveryManagerMac::Observer {
+ public BluetoothDiscoveryManagerMac::Observer,
+ public BluetoothLowEnergyDiscoveryManagerMac::Observer {
public:
static base::WeakPtr<BluetoothAdapter> CreateAdapter();
- // BluetoothAdapter:
+ // BluetoothAdapter overrides:
std::string GetAddress() const override;
std::string GetName() const override;
void SetName(const std::string& name,
@@ -76,15 +79,20 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterMac
const CreateAdvertisementCallback& callback,
const CreateAdvertisementErrorCallback& error_callback) override;
- // BluetoothDiscoveryManagerMac::Observer overrides
- void DeviceFound(IOBluetoothDevice* device) override;
- void DiscoveryStopped(bool unexpected) override;
+ // BluetoothDiscoveryManagerMac::Observer overrides:
+ void ClassicDeviceFound(IOBluetoothDevice* device) override;
+ void ClassicDiscoveryStopped(bool unexpected) override;
+
+ // BluetoothLowEnergyDiscoveryManagerMac::Observer override:
+ void LowEnergyDeviceUpdated(CBPeripheral* peripheral,
+ NSDictionary* advertisementData,
+ int rssi) override;
// Registers that a new |device| has connected to the local host.
void DeviceConnected(IOBluetoothDevice* device);
protected:
- // BluetoothAdapter:
+ // BluetoothAdapter override:
void RemovePairingDelegateInternal(
device::BluetoothDevice::PairingDelegate* pairing_delegate) override;
@@ -94,7 +102,7 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterMac
BluetoothAdapterMac();
~BluetoothAdapterMac() override;
- // BluetoothAdapter:
+ // BluetoothAdapter overrides:
void AddDiscoverySession(BluetoothDiscoveryFilter* discovery_filter,
const base::Closure& callback,
const ErrorCallback& error_callback) override;
@@ -105,13 +113,15 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterMac
const base::Closure& callback,
const ErrorCallback& error_callback) override;
scheib 2015/06/05 18:10:20 Comment.
krstnmnlsn 2015/06/09 01:08:09 Done.
+ bool StartDiscovery(BluetoothDiscoveryFilter* discovery_filter);
+
void Init();
void InitForTest(scoped_refptr<base::SequencedTaskRunner> ui_task_runner);
void PollAdapter();
// Registers that a new |device| has replied to an Inquiry, is paired, or has
// connected to the local host.
- void DeviceAdded(IOBluetoothDevice* device);
+ void ClassicDeviceAdded(IOBluetoothDevice* device);
// Updates |devices_| to include the currently paired devices, as well as any
// connected, but unpaired, devices. Notifies observers if any previously
@@ -127,6 +137,10 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterMac
// Discovery manager for Bluetooth Classic.
scoped_ptr<BluetoothDiscoveryManagerMac> classic_discovery_manager_;
+ // Discovery manager for Bluetooth Low Energy.
+ scoped_ptr<BluetoothLowEnergyDiscoveryManagerMac>
+ low_energy_discovery_manager_;
+
scoped_refptr<base::SequencedTaskRunner> ui_task_runner_;
base::WeakPtrFactory<BluetoothAdapterMac> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698