| 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_device_mac.h" | 5 #include "device/bluetooth/bluetooth_device_mac.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 | 212 |
| 213 void BluetoothDeviceMac::ConnectToService( | 213 void BluetoothDeviceMac::ConnectToService( |
| 214 const BluetoothUUID& uuid, | 214 const BluetoothUUID& uuid, |
| 215 const ConnectToServiceCallback& callback, | 215 const ConnectToServiceCallback& callback, |
| 216 const ConnectToServiceErrorCallback& error_callback) { | 216 const ConnectToServiceErrorCallback& error_callback) { |
| 217 scoped_refptr<BluetoothSocketMac> socket = BluetoothSocketMac::CreateSocket(); | 217 scoped_refptr<BluetoothSocketMac> socket = BluetoothSocketMac::CreateSocket(); |
| 218 socket->Connect( | 218 socket->Connect( |
| 219 device_.get(), uuid, base::Bind(callback, socket), error_callback); | 219 device_.get(), uuid, base::Bind(callback, socket), error_callback); |
| 220 } | 220 } |
| 221 | 221 |
| 222 void BluetoothDeviceMac::CreateGattConnection( |
| 223 const GattConnectionCallback& callback, |
| 224 const ConnectErrorCallback& error_callback) { |
| 225 // TODO(armansito): Implement. |
| 226 error_callback.Run(ERROR_UNKNOWN); |
| 227 } |
| 228 |
| 222 void BluetoothDeviceMac::StartConnectionMonitor( | 229 void BluetoothDeviceMac::StartConnectionMonitor( |
| 223 const base::Closure& callback, | 230 const base::Closure& callback, |
| 224 const ErrorCallback& error_callback) { | 231 const ErrorCallback& error_callback) { |
| 225 NOTIMPLEMENTED(); | 232 NOTIMPLEMENTED(); |
| 226 } | 233 } |
| 227 | 234 |
| 228 int BluetoothDeviceMac::GetHostTransmitPower( | 235 int BluetoothDeviceMac::GetHostTransmitPower( |
| 229 BluetoothHCITransmitPowerLevelType power_level_type) const { | 236 BluetoothHCITransmitPowerLevelType power_level_type) const { |
| 230 IOBluetoothHostController* controller = | 237 IOBluetoothHostController* controller = |
| 231 [IOBluetoothHostController defaultController]; | 238 [IOBluetoothHostController defaultController]; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 246 | 253 |
| 247 return power_level; | 254 return power_level; |
| 248 } | 255 } |
| 249 | 256 |
| 250 // static | 257 // static |
| 251 std::string BluetoothDeviceMac::GetDeviceAddress(IOBluetoothDevice* device) { | 258 std::string BluetoothDeviceMac::GetDeviceAddress(IOBluetoothDevice* device) { |
| 252 return CanonicalizeAddress(base::SysNSStringToUTF8([device addressString])); | 259 return CanonicalizeAddress(base::SysNSStringToUTF8([device addressString])); |
| 253 } | 260 } |
| 254 | 261 |
| 255 } // namespace device | 262 } // namespace device |
| OLD | NEW |