| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 void LowEnergyCentralManagerUpdatedState(); | 151 void LowEnergyCentralManagerUpdatedState(); |
| 152 | 152 |
| 153 // Removes from |devices_| any previously paired, connected or seen devices | 153 // Removes from |devices_| any previously paired, connected or seen devices |
| 154 // which are no longer present. Notifies observers. | 154 // which are no longer present. Notifies observers. |
| 155 void RemoveTimedOutDevices(); | 155 void RemoveTimedOutDevices(); |
| 156 | 156 |
| 157 // Updates |devices_| to include the currently paired devices and notifies | 157 // Updates |devices_| to include the currently paired devices and notifies |
| 158 // observers. | 158 // observers. |
| 159 void AddPairedDevices(); | 159 void AddPairedDevices(); |
| 160 | 160 |
| 161 // Invoked by CoreBluetooth after completing a connect to device request. |
| 162 void DidConnectPeripheral(CBPeripheral* peripheral); |
| 163 void DidConnectPeripheralError(CBPeripheral* peripheral, NSError* error); |
| 164 void DidDisconnectPeripheral(CBPeripheral* peripheral, NSError* error); |
| 165 |
| 161 std::string address_; | 166 std::string address_; |
| 162 std::string name_; | 167 std::string name_; |
| 163 bool classic_powered_; | 168 bool classic_powered_; |
| 164 int num_discovery_sessions_; | 169 int num_discovery_sessions_; |
| 165 | 170 |
| 166 // Discovery manager for Bluetooth Classic. | 171 // Discovery manager for Bluetooth Classic. |
| 167 scoped_ptr<BluetoothDiscoveryManagerMac> classic_discovery_manager_; | 172 scoped_ptr<BluetoothDiscoveryManagerMac> classic_discovery_manager_; |
| 168 | 173 |
| 169 // Discovery manager for Bluetooth Low Energy. | 174 // Discovery manager for Bluetooth Low Energy. |
| 170 scoped_ptr<BluetoothLowEnergyDiscoveryManagerMac> | 175 scoped_ptr<BluetoothLowEnergyDiscoveryManagerMac> |
| 171 low_energy_discovery_manager_; | 176 low_energy_discovery_manager_; |
| 172 | 177 |
| 173 // Underlying CoreBluetooth CBCentralManager and its delegate. | 178 // Underlying CoreBluetooth CBCentralManager and its delegate. |
| 174 base::scoped_nsobject<CBCentralManager> low_energy_central_manager_; | 179 base::scoped_nsobject<CBCentralManager> low_energy_central_manager_; |
| 175 base::scoped_nsobject<BluetoothLowEnergyCentralManagerDelegate> | 180 base::scoped_nsobject<BluetoothLowEnergyCentralManagerDelegate> |
| 176 low_energy_central_manager_delegate_; | 181 low_energy_central_manager_delegate_; |
| 177 | 182 |
| 178 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; | 183 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; |
| 179 | 184 |
| 180 base::WeakPtrFactory<BluetoothAdapterMac> weak_ptr_factory_; | 185 base::WeakPtrFactory<BluetoothAdapterMac> weak_ptr_factory_; |
| 181 | 186 |
| 182 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterMac); | 187 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterMac); |
| 183 }; | 188 }; |
| 184 | 189 |
| 185 } // namespace device | 190 } // namespace device |
| 186 | 191 |
| 187 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_H_ | 192 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_H_ |
| OLD | NEW |