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 <memory> | 10 #include <memory> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 public: | 46 public: |
47 static base::WeakPtr<BluetoothAdapterMac> CreateAdapter(); | 47 static base::WeakPtr<BluetoothAdapterMac> CreateAdapter(); |
48 static base::WeakPtr<BluetoothAdapterMac> CreateAdapterForTest( | 48 static base::WeakPtr<BluetoothAdapterMac> CreateAdapterForTest( |
49 std::string name, | 49 std::string name, |
50 std::string address, | 50 std::string address, |
51 scoped_refptr<base::SequencedTaskRunner> ui_task_runner); | 51 scoped_refptr<base::SequencedTaskRunner> ui_task_runner); |
52 | 52 |
53 // Converts CBUUID into BluetoothUUID | 53 // Converts CBUUID into BluetoothUUID |
54 static BluetoothUUID BluetoothUUIDWithCBUUID(CBUUID* UUID); | 54 static BluetoothUUID BluetoothUUIDWithCBUUID(CBUUID* UUID); |
55 | 55 |
| 56 // Converts NSError to string for logging. |
| 57 static std::string String(NSError* error); |
| 58 |
56 // BluetoothAdapter overrides: | 59 // BluetoothAdapter overrides: |
57 std::string GetAddress() const override; | 60 std::string GetAddress() const override; |
58 std::string GetName() const override; | 61 std::string GetName() const override; |
59 void SetName(const std::string& name, | 62 void SetName(const std::string& name, |
60 const base::Closure& callback, | 63 const base::Closure& callback, |
61 const ErrorCallback& error_callback) override; | 64 const ErrorCallback& error_callback) override; |
62 bool IsInitialized() const override; | 65 bool IsInitialized() const override; |
63 bool IsPresent() const override; | 66 bool IsPresent() const override; |
64 bool IsPowered() const override; | 67 bool IsPowered() const override; |
65 void SetPowered(bool powered, | 68 void SetPowered(bool powered, |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 base::scoped_nsobject<BluetoothLowEnergyCentralManagerDelegate> | 225 base::scoped_nsobject<BluetoothLowEnergyCentralManagerDelegate> |
223 low_energy_central_manager_delegate_; | 226 low_energy_central_manager_delegate_; |
224 | 227 |
225 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; | 228 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; |
226 | 229 |
227 base::WeakPtrFactory<BluetoothAdapterMac> weak_ptr_factory_; | 230 base::WeakPtrFactory<BluetoothAdapterMac> weak_ptr_factory_; |
228 | 231 |
229 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterMac); | 232 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterMac); |
230 }; | 233 }; |
231 | 234 |
232 // Stream operator for logging. | |
233 DEVICE_BLUETOOTH_EXPORT std::ostream& operator<<(std::ostream& out, | |
234 NSError* error); | |
235 | |
236 } // namespace device | 235 } // namespace device |
237 | 236 |
238 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_H_ | 237 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_H_ |
OLD | NEW |