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_classic_device_mac.h" | 5 #include "device/bluetooth/bluetooth_classic_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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 DCHECK_EQ(uuid_str.size(), 32U); | 51 DCHECK_EQ(uuid_str.size(), 32U); |
52 uuid_str.insert(8, "-"); | 52 uuid_str.insert(8, "-"); |
53 uuid_str.insert(13, "-"); | 53 uuid_str.insert(13, "-"); |
54 uuid_str.insert(18, "-"); | 54 uuid_str.insert(18, "-"); |
55 uuid_str.insert(23, "-"); | 55 uuid_str.insert(23, "-"); |
56 return BluetoothUUID(uuid_str); | 56 return BluetoothUUID(uuid_str); |
57 } | 57 } |
58 | 58 |
59 } // namespace | 59 } // namespace |
60 | 60 |
61 BluetoothClassicDeviceMac::BluetoothClassicDeviceMac(IOBluetoothDevice* device) | 61 BluetoothClassicDeviceMac::BluetoothClassicDeviceMac( |
62 : device_([device retain]) { | 62 BluetoothAdapterMac* adapter, |
63 } | 63 IOBluetoothDevice* device) |
| 64 : BluetoothDeviceMac(adapter), device_([device retain]) {} |
64 | 65 |
65 BluetoothClassicDeviceMac::~BluetoothClassicDeviceMac() { | 66 BluetoothClassicDeviceMac::~BluetoothClassicDeviceMac() { |
66 } | 67 } |
67 | 68 |
68 uint32 BluetoothClassicDeviceMac::GetBluetoothClass() const { | 69 uint32 BluetoothClassicDeviceMac::GetBluetoothClass() const { |
69 return [device_ classOfDevice]; | 70 return [device_ classOfDevice]; |
70 } | 71 } |
71 | 72 |
72 std::string BluetoothClassicDeviceMac::GetDeviceName() const { | 73 std::string BluetoothClassicDeviceMac::GetDeviceName() const { |
73 return base::SysNSStringToUTF8([device_ name]); | 74 return base::SysNSStringToUTF8([device_ name]); |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 return power_level; | 260 return power_level; |
260 } | 261 } |
261 | 262 |
262 // static | 263 // static |
263 std::string BluetoothClassicDeviceMac::GetDeviceAddress( | 264 std::string BluetoothClassicDeviceMac::GetDeviceAddress( |
264 IOBluetoothDevice* device) { | 265 IOBluetoothDevice* device) { |
265 return CanonicalizeAddress(base::SysNSStringToUTF8([device addressString])); | 266 return CanonicalizeAddress(base::SysNSStringToUTF8([device addressString])); |
266 } | 267 } |
267 | 268 |
268 } // namespace device | 269 } // namespace device |
OLD | NEW |