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> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 supports_rfcomm_ = | 60 supports_rfcomm_ = |
61 [record getRFCOMMChannelID:&rfcomm_channel_] == kIOReturnSuccess; | 61 [record getRFCOMMChannelID:&rfcomm_channel_] == kIOReturnSuccess; |
62 | 62 |
63 const BluetoothSDPServiceAttributeID service_class_id = 1; | 63 const BluetoothSDPServiceAttributeID service_class_id = 1; |
64 | 64 |
65 IOBluetoothSDPDataElement* service_class_data = | 65 IOBluetoothSDPDataElement* service_class_data = |
66 [record getAttributeDataElement:service_class_id]; | 66 [record getAttributeDataElement:service_class_id]; |
67 if ([service_class_data getTypeDescriptor] == | 67 if ([service_class_data getTypeDescriptor] == |
68 kBluetoothSDPDataElementTypeDataElementSequence) { | 68 kBluetoothSDPDataElementTypeDataElementSequence) { |
69 std::string uuid_str; | 69 ExtractUuid(service_class_data, &uuid_); |
70 ExtractUuid(service_class_data, &uuid_str); | |
71 uuid_ = BluetoothUUID(uuid_str); | |
72 } | 70 } |
73 } | 71 } |
74 | 72 |
75 BluetoothServiceRecordMac::~BluetoothServiceRecordMac() { | 73 BluetoothServiceRecordMac::~BluetoothServiceRecordMac() { |
76 [device_ release]; | 74 [device_ release]; |
77 } | 75 } |
78 | 76 |
79 } // namespace device | 77 } // namespace device |
OLD | NEW |