Chromium Code Reviews| Index: device/bluetooth/bluetooth_adapter_mac.h |
| diff --git a/device/bluetooth/bluetooth_adapter_mac.h b/device/bluetooth/bluetooth_adapter_mac.h |
| index 472c2f9bd104fc65cdf9e53719324d8612bc1069..d75cbc53e912031cb930a38893c9c7910dffa668 100644 |
| --- a/device/bluetooth/bluetooth_adapter_mac.h |
| +++ b/device/bluetooth/bluetooth_adapter_mac.h |
| @@ -97,16 +97,28 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterMac |
| // (crbug.com/506287). |
| static bool IsLowEnergyAvailable(); |
| - // Resets |low_energy_central_manager_| to |central_manager| and sets |
| - // |low_energy_central_manager_delegate_| as the manager's delegate. Should |
| - // be called only when |IsLowEnergyAvailable()|. |
| - void SetCentralManagerForTesting(CBCentralManager* central_manager); |
| + // Creates a GATT connection by calling CoreBluetooth APIs. |
| + void CreateGattConnection(BluetoothLowEnergyDeviceMac* device_mac); |
| + |
| + // Closes the GATT connection by calling CoreBluetooth APIs. |
| + void DisconnectGatt(BluetoothLowEnergyDeviceMac* device_mac); |
| + |
| + // Methods called from CBCentralManager delegate. |
| + void DidConnectPeripheral(CBPeripheral* peripheral); |
| + void DidFailToConnectPeripheral(CBPeripheral* peripheral, NSError* error); |
| + void DidDisconnectPeripheral(CBPeripheral* peripheral, NSError* error); |
| protected: |
| // BluetoothAdapter override: |
| void RemovePairingDelegateInternal( |
| device::BluetoothDevice::PairingDelegate* pairing_delegate) override; |
| + // Resets |low_energy_central_manager_| to |central_manager| and sets |
| + // |low_energy_central_manager_delegate_| as the manager's delegate. Should |
| + // be called only when |IsLowEnergyAvailable()|. |
| + void SetCentralManagerForTesting(CBCentralManager* central_manager); |
| + CBCentralManager* GetCentralManagerForTesting(); |
|
msarda
2016/02/11 10:55:38
Why is this method protected and not private? Do y
jlebel
2016/02/19 11:02:35
Done.
|
| + |
| private: |
| // The length of time that must elapse since the last Inquiry response (on |
| // Classic devices) or call to BluetoothLowEnergyDevice::Update() (on Low |
| @@ -162,6 +174,10 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterMac |
| // observers. |
| void AddPairedDevices(); |
| + // Returns the BLE device associated with the CoreBluetooth peripheral. |
| + BluetoothLowEnergyDeviceMac* GetBluetoothLowEnergyDeviceMac( |
| + CBPeripheral* peripheral); |
| + |
| std::string address_; |
| std::string name_; |
| bool classic_powered_; |