Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1486)

Side by Side Diff: device/bluetooth/bluetooth_classic_device_mac.mm

Issue 2244693002: bluetooth: Refactor how we update based on Advertising Data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix arc Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/bind.h" 9 #include "base/bind.h"
10 #include "base/hash.h" 10 #include "base/hash.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 125 }
126 126
127 bool BluetoothClassicDeviceMac::IsConnectable() const { 127 bool BluetoothClassicDeviceMac::IsConnectable() const {
128 return false; 128 return false;
129 } 129 }
130 130
131 bool BluetoothClassicDeviceMac::IsConnecting() const { 131 bool BluetoothClassicDeviceMac::IsConnecting() const {
132 return false; 132 return false;
133 } 133 }
134 134
135 BluetoothDevice::UUIDList BluetoothClassicDeviceMac::GetUUIDs() const { 135 BluetoothDevice::UUIDSet BluetoothClassicDeviceMac::GetUUIDs() const {
136 UUIDList uuids; 136 UUIDSet uuids;
137 for (IOBluetoothSDPServiceRecord* service_record in [device_ services]) { 137 for (IOBluetoothSDPServiceRecord* service_record in [device_ services]) {
138 IOBluetoothSDPDataElement* service_class_data = 138 IOBluetoothSDPDataElement* service_class_data =
139 [service_record getAttributeDataElement: 139 [service_record getAttributeDataElement:
140 kBluetoothSDPAttributeIdentifierServiceClassIDList]; 140 kBluetoothSDPAttributeIdentifierServiceClassIDList];
141 if ([service_class_data getTypeDescriptor] == 141 if ([service_class_data getTypeDescriptor] ==
142 kBluetoothSDPDataElementTypeDataElementSequence) { 142 kBluetoothSDPDataElementTypeDataElementSequence) {
143 BluetoothUUID uuid = ExtractUuid(service_class_data); 143 BluetoothUUID uuid = ExtractUuid(service_class_data);
144 if (uuid.IsValid()) 144 if (uuid.IsValid())
145 uuids.push_back(uuid); 145 uuids.insert(uuid);
146 } 146 }
147 } 147 }
148 return uuids; 148 return uuids;
149 } 149 }
150 150
151 base::Optional<int8_t> BluetoothClassicDeviceMac::GetInquiryRSSI() const { 151 base::Optional<int8_t> BluetoothClassicDeviceMac::GetInquiryRSSI() const {
152 return base::nullopt; 152 return base::nullopt;
153 } 153 }
154 154
155 base::Optional<int8_t> BluetoothClassicDeviceMac::GetInquiryTxPower() const { 155 base::Optional<int8_t> BluetoothClassicDeviceMac::GetInquiryTxPower() const {
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 return power_level; 282 return power_level;
283 } 283 }
284 284
285 // static 285 // static
286 std::string BluetoothClassicDeviceMac::GetDeviceAddress( 286 std::string BluetoothClassicDeviceMac::GetDeviceAddress(
287 IOBluetoothDevice* device) { 287 IOBluetoothDevice* device) {
288 return CanonicalizeAddress(base::SysNSStringToUTF8([device addressString])); 288 return CanonicalizeAddress(base::SysNSStringToUTF8([device addressString]));
289 } 289 }
290 290
291 } // namespace device 291 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698