Index: device/bluetooth/bluetooth_low_energy_device_mac.mm |
diff --git a/device/bluetooth/bluetooth_low_energy_device_mac.mm b/device/bluetooth/bluetooth_low_energy_device_mac.mm |
index 41a4fb9a2f89fa0f0e9c9aa54468454585eeadab..4600828f8f4dd915f2e9ac6d501def03cc01ea28 100644 |
--- a/device/bluetooth/bluetooth_low_energy_device_mac.mm |
+++ b/device/bluetooth/bluetooth_low_energy_device_mac.mm |
@@ -53,18 +53,23 @@ void BluetoothLowEnergyDeviceMac::Update(CBPeripheral* peripheral, |
connectable_ = [connectable boolValue]; |
ClearServiceData(); |
NSDictionary* service_data = |
- [advertisement_data objectForKey:@"CBAdvertisementDataServiceDataKey"]; |
+ [advertisement_data objectForKey:CBAdvertisementDataServiceDataKey]; |
for (CBUUID* uuid in service_data) { |
NSData* data = [service_data objectForKey:uuid]; |
BluetoothUUID service_uuid = BluetoothUUIDWithCBUUID(uuid); |
SetServiceData(service_uuid, static_cast<const char*>([data bytes]), |
[data length]); |
} |
- advertised_uuids_.clear(); |
NSArray* service_uuids = |
- [advertisement_data objectForKey:@"CBAdvertisementDataServiceUUIDsKey"]; |
+ [advertisement_data objectForKey:CBAdvertisementDataServiceUUIDsKey]; |
for (CBUUID* uuid in service_uuids) { |
- advertised_uuids_.push_back( |
+ advertised_uuids_.insert( |
+ BluetoothUUID(std::string([[uuid UUIDString] UTF8String]))); |
+ } |
+ NSArray* overflow_service_uuids = [advertisement_data |
+ objectForKey:CBAdvertisementDataOverflowServiceUUIDsKey]; |
+ for (CBUUID* uuid in overflow_service_uuids) { |
+ advertised_uuids_.insert( |
BluetoothUUID(std::string([[uuid UUIDString] UTF8String]))); |
} |
} |
@@ -119,7 +124,10 @@ bool BluetoothLowEnergyDeviceMac::IsConnecting() const { |
} |
BluetoothDevice::UUIDList BluetoothLowEnergyDeviceMac::GetUUIDs() const { |
- return advertised_uuids_; |
+ BluetoothDevice::UUIDList advertised_uuids_list; |
scheib
2015/08/05 00:04:35
Hmm.. yep, have to either make copies here... or k
krstnmnlsn
2015/08/05 16:44:09
Done.
|
+ for (BluetoothUUID uuid : advertised_uuids_) |
+ advertised_uuids_list.push_back(uuid); |
+ return advertised_uuids_list; |
} |
int16 BluetoothLowEnergyDeviceMac::GetInquiryRSSI() const { |