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_service_record_mac.h" | 5 #include "device/bluetooth/bluetooth_service_record_mac.h" |
6 | 6 |
7 #include <IOBluetooth/Bluetooth.h> | 7 #include <IOBluetooth/Bluetooth.h> |
8 #import <IOBluetooth/IOBluetoothUtilities.h> | 8 #import <IOBluetooth/IOBluetoothUtilities.h> |
9 #import <IOBluetooth/objc/IOBluetoothDevice.h> | 9 #import <IOBluetooth/objc/IOBluetoothDevice.h> |
10 #import <IOBluetooth/objc/IOBluetoothSDPDataElement.h> | 10 #import <IOBluetooth/objc/IOBluetoothSDPDataElement.h> |
11 #import <IOBluetooth/objc/IOBluetoothSDPServiceRecord.h> | 11 #import <IOBluetooth/objc/IOBluetoothSDPServiceRecord.h> |
12 #import <IOBluetooth/objc/IOBluetoothSDPUUID.h> | 12 #import <IOBluetooth/objc/IOBluetoothSDPUUID.h> |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 | 15 |
16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
17 #include "base/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
18 #include "base/strings/sys_string_conversions.h" | 18 #include "base/strings/sys_string_conversions.h" |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 void ExtractUuid(IOBluetoothSDPDataElement* service_class_data, | 22 void ExtractUuid(IOBluetoothSDPDataElement* service_class_data, |
23 std::string* uuid) { | 23 std::string* uuid) { |
24 NSArray* inner_elements = [service_class_data getArrayValue]; | 24 NSArray* inner_elements = [service_class_data getArrayValue]; |
25 IOBluetoothSDPUUID* sdp_uuid = nil; | 25 IOBluetoothSDPUUID* sdp_uuid = nil; |
26 for (IOBluetoothSDPDataElement* inner_element in inner_elements) { | 26 for (IOBluetoothSDPDataElement* inner_element in inner_elements) { |
27 if ([inner_element getTypeDescriptor] == kBluetoothSDPDataElementTypeUUID) { | 27 if ([inner_element getTypeDescriptor] == kBluetoothSDPDataElementTypeUUID) { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 kBluetoothSDPDataElementTypeDataElementSequence) { | 68 kBluetoothSDPDataElementTypeDataElementSequence) { |
69 ExtractUuid(service_class_data, &uuid_); | 69 ExtractUuid(service_class_data, &uuid_); |
70 } | 70 } |
71 } | 71 } |
72 | 72 |
73 BluetoothServiceRecordMac::~BluetoothServiceRecordMac() { | 73 BluetoothServiceRecordMac::~BluetoothServiceRecordMac() { |
74 [device_ release]; | 74 [device_ release]; |
75 } | 75 } |
76 | 76 |
77 } // namespace device | 77 } // namespace device |
OLD | NEW |