| 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 #include "device/bluetooth/bluetooth_adapter_mac.h" | 5 #include "device/bluetooth/bluetooth_adapter_mac.h" |
| 6 | 6 |
| 7 #import <IOBluetooth/objc/IOBluetoothDevice.h> | 7 #import <IOBluetooth/objc/IOBluetoothDevice.h> |
| 8 #import <IOBluetooth/objc/IOBluetoothHostController.h> | 8 #import <IOBluetooth/objc/IOBluetoothHostController.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 void BluetoothAdapterMac::CreateL2capService( | 188 void BluetoothAdapterMac::CreateL2capService( |
| 189 const BluetoothUUID& uuid, | 189 const BluetoothUUID& uuid, |
| 190 const ServiceOptions& options, | 190 const ServiceOptions& options, |
| 191 const CreateServiceCallback& callback, | 191 const CreateServiceCallback& callback, |
| 192 const CreateServiceErrorCallback& error_callback) { | 192 const CreateServiceErrorCallback& error_callback) { |
| 193 scoped_refptr<BluetoothSocketMac> socket = BluetoothSocketMac::CreateSocket(); | 193 scoped_refptr<BluetoothSocketMac> socket = BluetoothSocketMac::CreateSocket(); |
| 194 socket->ListenUsingL2cap( | 194 socket->ListenUsingL2cap( |
| 195 this, uuid, options, base::Bind(callback, socket), error_callback); | 195 this, uuid, options, base::Bind(callback, socket), error_callback); |
| 196 } | 196 } |
| 197 | 197 |
| 198 void BluetoothAdapterMac::RegisterAudioSink( | |
| 199 const BluetoothAudioSink::Options& options, | |
| 200 const AcquiredCallback& callback, | |
| 201 const BluetoothAudioSink::ErrorCallback& error_callback) { | |
| 202 NOTIMPLEMENTED(); | |
| 203 error_callback.Run(BluetoothAudioSink::ERROR_UNSUPPORTED_PLATFORM); | |
| 204 } | |
| 205 | |
| 206 void BluetoothAdapterMac::RegisterAdvertisement( | 198 void BluetoothAdapterMac::RegisterAdvertisement( |
| 207 std::unique_ptr<BluetoothAdvertisement::Data> advertisement_data, | 199 std::unique_ptr<BluetoothAdvertisement::Data> advertisement_data, |
| 208 const CreateAdvertisementCallback& callback, | 200 const CreateAdvertisementCallback& callback, |
| 209 const AdvertisementErrorCallback& error_callback) { | 201 const AdvertisementErrorCallback& error_callback) { |
| 210 NOTIMPLEMENTED(); | 202 NOTIMPLEMENTED(); |
| 211 error_callback.Run(BluetoothAdvertisement::ERROR_UNSUPPORTED_PLATFORM); | 203 error_callback.Run(BluetoothAdvertisement::ERROR_UNSUPPORTED_PLATFORM); |
| 212 } | 204 } |
| 213 | 205 |
| 214 BluetoothLocalGattService* BluetoothAdapterMac::GetGattService( | 206 BluetoothLocalGattService* BluetoothAdapterMac::GetGattService( |
| 215 const std::string& identifier) const { | 207 const std::string& identifier) const { |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 std::string device_address = | 638 std::string device_address = |
| 647 BluetoothLowEnergyDeviceMac::GetPeripheralHashAddress(peripheral); | 639 BluetoothLowEnergyDeviceMac::GetPeripheralHashAddress(peripheral); |
| 648 DevicesMap::const_iterator iter = devices_.find(device_address); | 640 DevicesMap::const_iterator iter = devices_.find(device_address); |
| 649 if (iter == devices_.end()) { | 641 if (iter == devices_.end()) { |
| 650 return nil; | 642 return nil; |
| 651 } | 643 } |
| 652 return static_cast<BluetoothLowEnergyDeviceMac*>(iter->second); | 644 return static_cast<BluetoothLowEnergyDeviceMac*>(iter->second); |
| 653 } | 645 } |
| 654 | 646 |
| 655 } // namespace device | 647 } // namespace device |
| OLD | NEW |