Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_H_ |
| 7 | 7 |
| 8 #include <IOKit/IOReturn.h> | 8 #include <IOKit/IOReturn.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 // CBCentralManager destructor was found to crash on the mac_chromium_rel_ng | 94 // CBCentralManager destructor was found to crash on the mac_chromium_rel_ng |
| 95 // builder running 10.9.5. May also cause blued to crash on OS X 10.9.5 | 95 // builder running 10.9.5. May also cause blued to crash on OS X 10.9.5 |
| 96 // (crbug.com/506287). | 96 // (crbug.com/506287). |
| 97 static bool IsLowEnergyAvailable(); | 97 static bool IsLowEnergyAvailable(); |
| 98 | 98 |
| 99 // Resets |low_energy_central_manager_| to |central_manager| and sets | 99 // Resets |low_energy_central_manager_| to |central_manager| and sets |
| 100 // |low_energy_central_manager_delegate_| as the manager's delegate. Should | 100 // |low_energy_central_manager_delegate_| as the manager's delegate. Should |
| 101 // be called only when |IsLowEnergyAvailable()|. | 101 // be called only when |IsLowEnergyAvailable()|. |
| 102 void SetCentralManagerForTesting(CBCentralManager* central_manager); | 102 void SetCentralManagerForTesting(CBCentralManager* central_manager); |
| 103 | 103 |
| 104 void CreateGattConnection(BluetoothLowEnergyDeviceMac* deviceMac); | |
|
François Beaufort
2015/12/22 07:38:17
s/deviceMac/device_mac
jlebel
2016/02/10 13:38:51
Done.
| |
| 105 void DidConnectPeripheral(CBPeripheral* peripheral); | |
| 106 void DisconnectGatt(BluetoothLowEnergyDeviceMac* deviceMac); | |
|
François Beaufort
2015/12/22 07:38:17
s/deviceMac/device_mac
jlebel
2016/02/10 13:38:51
Done.
| |
| 107 | |
| 104 protected: | 108 protected: |
| 105 // BluetoothAdapter override: | 109 // BluetoothAdapter override: |
| 106 void RemovePairingDelegateInternal( | 110 void RemovePairingDelegateInternal( |
| 107 device::BluetoothDevice::PairingDelegate* pairing_delegate) override; | 111 device::BluetoothDevice::PairingDelegate* pairing_delegate) override; |
| 108 | 112 |
| 109 private: | 113 private: |
| 110 // The length of time that must elapse since the last Inquiry response (on | 114 // The length of time that must elapse since the last Inquiry response (on |
| 111 // Classic devices) or call to BluetoothLowEnergyDevice::Update() (on Low | 115 // Classic devices) or call to BluetoothLowEnergyDevice::Update() (on Low |
| 112 // Energy) before a discovered device is considered to be no longer available. | 116 // Energy) before a discovered device is considered to be no longer available. |
| 113 const static NSTimeInterval kDiscoveryTimeoutSec; | 117 const static NSTimeInterval kDiscoveryTimeoutSec; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 181 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; | 185 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; |
| 182 | 186 |
| 183 base::WeakPtrFactory<BluetoothAdapterMac> weak_ptr_factory_; | 187 base::WeakPtrFactory<BluetoothAdapterMac> weak_ptr_factory_; |
| 184 | 188 |
| 185 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterMac); | 189 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterMac); |
| 186 }; | 190 }; |
| 187 | 191 |
| 188 } // namespace device | 192 } // namespace device |
| 189 | 193 |
| 190 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_H_ | 194 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_H_ |
| OLD | NEW |