| 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 BluetoothLowEnergyDiscoveryManagerMac::Observer { | 46 public BluetoothLowEnergyDiscoveryManagerMac::Observer { |
| 47 public: | 47 public: |
| 48 static base::WeakPtr<BluetoothAdapterMac> CreateAdapter(); | 48 static base::WeakPtr<BluetoothAdapterMac> CreateAdapter(); |
| 49 static base::WeakPtr<BluetoothAdapterMac> CreateAdapterForTest( | 49 static base::WeakPtr<BluetoothAdapterMac> CreateAdapterForTest( |
| 50 std::string name, | 50 std::string name, |
| 51 std::string address, | 51 std::string address, |
| 52 scoped_refptr<base::SequencedTaskRunner> ui_task_runner); | 52 scoped_refptr<base::SequencedTaskRunner> ui_task_runner); |
| 53 | 53 |
| 54 // Converts CBUUID into BluetoothUUID | 54 // Converts CBUUID into BluetoothUUID |
| 55 static BluetoothUUID BluetoothUUIDWithCBUUID(CBUUID* UUID); | 55 static BluetoothUUID BluetoothUUIDWithCBUUID(CBUUID* UUID); |
| 56 // Converts list of BluetoothUUID to NSArray of CBUUID. Returns nil if the |
| 57 // list is empty. |
| 58 static NSArray* CBUUIDArrayWithUUIDList( |
| 59 BluetoothDevice::UUIDList services_uuids); |
| 56 | 60 |
| 57 // BluetoothAdapter overrides: | 61 // BluetoothAdapter overrides: |
| 58 std::string GetAddress() const override; | 62 std::string GetAddress() const override; |
| 59 std::string GetName() const override; | 63 std::string GetName() const override; |
| 60 void SetName(const std::string& name, | 64 void SetName(const std::string& name, |
| 61 const base::Closure& callback, | 65 const base::Closure& callback, |
| 62 const ErrorCallback& error_callback) override; | 66 const ErrorCallback& error_callback) override; |
| 63 bool IsInitialized() const override; | 67 bool IsInitialized() const override; |
| 64 bool IsPresent() const override; | 68 bool IsPresent() const override; |
| 65 bool IsPowered() const override; | 69 bool IsPowered() const override; |
| 66 void SetPowered(bool powered, | 70 void SetPowered(bool powered, |
| 67 const base::Closure& callback, | 71 const base::Closure& callback, |
| 68 const ErrorCallback& error_callback) override; | 72 const ErrorCallback& error_callback) override; |
| 69 bool IsDiscoverable() const override; | 73 bool IsDiscoverable() const override; |
| 70 void SetDiscoverable(bool discoverable, | 74 void SetDiscoverable(bool discoverable, |
| 71 const base::Closure& callback, | 75 const base::Closure& callback, |
| 72 const ErrorCallback& error_callback) override; | 76 const ErrorCallback& error_callback) override; |
| 73 bool IsDiscovering() const override; | 77 bool IsDiscovering() const override; |
| 78 void RetrievedConnectedPeripherals() override; |
| 74 UUIDList GetUUIDs() const override; | 79 UUIDList GetUUIDs() const override; |
| 75 void CreateRfcommService( | 80 void CreateRfcommService( |
| 76 const BluetoothUUID& uuid, | 81 const BluetoothUUID& uuid, |
| 77 const ServiceOptions& options, | 82 const ServiceOptions& options, |
| 78 const CreateServiceCallback& callback, | 83 const CreateServiceCallback& callback, |
| 79 const CreateServiceErrorCallback& error_callback) override; | 84 const CreateServiceErrorCallback& error_callback) override; |
| 80 void CreateL2capService( | 85 void CreateL2capService( |
| 81 const BluetoothUUID& uuid, | 86 const BluetoothUUID& uuid, |
| 82 const ServiceOptions& options, | 87 const ServiceOptions& options, |
| 83 const CreateServiceCallback& callback, | 88 const CreateServiceCallback& callback, |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; | 210 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; |
| 206 | 211 |
| 207 base::WeakPtrFactory<BluetoothAdapterMac> weak_ptr_factory_; | 212 base::WeakPtrFactory<BluetoothAdapterMac> weak_ptr_factory_; |
| 208 | 213 |
| 209 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterMac); | 214 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterMac); |
| 210 }; | 215 }; |
| 211 | 216 |
| 212 } // namespace device | 217 } // namespace device |
| 213 | 218 |
| 214 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_H_ | 219 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_H_ |
| OLD | NEW |