| 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/hash.h" | 10 #include "base/hash.h" |
| 11 #include "base/mac/sdk_forward_declarations.h" |
| 11 #include "base/sequenced_task_runner.h" | 12 #include "base/sequenced_task_runner.h" |
| 12 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 14 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
| 15 #include "base/strings/sys_string_conversions.h" | 16 #include "base/strings/sys_string_conversions.h" |
| 16 #include "device/bluetooth/bluetooth_profile_mac.h" | 17 #include "device/bluetooth/bluetooth_profile_mac.h" |
| 17 #include "device/bluetooth/bluetooth_service_record_mac.h" | 18 #include "device/bluetooth/bluetooth_service_record_mac.h" |
| 18 #include "device/bluetooth/bluetooth_socket_mac.h" | 19 #include "device/bluetooth/bluetooth_socket_mac.h" |
| 19 #include "device/bluetooth/bluetooth_uuid.h" | 20 #include "device/bluetooth/bluetooth_uuid.h" |
| 20 | 21 |
| 21 // Replicate specific 10.7 SDK declarations for building with prior SDKs. | |
| 22 #if !defined(MAC_OS_X_VERSION_10_7) || \ | |
| 23 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 | |
| 24 | |
| 25 @interface IOBluetoothDevice (LionSDKDeclarations) | |
| 26 - (NSString*)addressString; | |
| 27 - (unsigned int)classOfDevice; | |
| 28 - (BluetoothConnectionHandle)connectionHandle; | |
| 29 - (BluetoothHCIRSSIValue)rawRSSI; | |
| 30 - (NSArray*)services; | |
| 31 @end | |
| 32 | |
| 33 #endif // MAC_OS_X_VERSION_10_7 | |
| 34 | |
| 35 // Undocumented API for accessing the Bluetooth transmit power level. | 22 // Undocumented API for accessing the Bluetooth transmit power level. |
| 36 // Similar to the API defined here [ http://goo.gl/20Q5vE ]. | 23 // Similar to the API defined here [ http://goo.gl/20Q5vE ]. |
| 37 @interface IOBluetoothHostController (UndocumentedAPI) | 24 @interface IOBluetoothHostController (UndocumentedAPI) |
| 38 - (IOReturn) | 25 - (IOReturn) |
| 39 BluetoothHCIReadTransmitPowerLevel:(BluetoothConnectionHandle)connection | 26 BluetoothHCIReadTransmitPowerLevel:(BluetoothConnectionHandle)connection |
| 40 inType:(BluetoothHCITransmitPowerLevelType)type | 27 inType:(BluetoothHCITransmitPowerLevelType)type |
| 41 outTransmitPowerLevel:(BluetoothHCITransmitPowerLevel*)level; | 28 outTransmitPowerLevel:(BluetoothHCITransmitPowerLevel*)level; |
| 42 @end | 29 @end |
| 43 | 30 |
| 44 namespace device { | 31 namespace device { |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 222 |
| 236 return power_level; | 223 return power_level; |
| 237 } | 224 } |
| 238 | 225 |
| 239 // static | 226 // static |
| 240 std::string BluetoothDeviceMac::GetDeviceAddress(IOBluetoothDevice* device) { | 227 std::string BluetoothDeviceMac::GetDeviceAddress(IOBluetoothDevice* device) { |
| 241 return CanonicalizeAddress(base::SysNSStringToUTF8([device addressString])); | 228 return CanonicalizeAddress(base::SysNSStringToUTF8([device addressString])); |
| 242 } | 229 } |
| 243 | 230 |
| 244 } // namespace device | 231 } // namespace device |
| OLD | NEW |