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

Unified Diff: device/bluetooth/bluetooth_low_energy_device_mac.mm

Issue 1272503002: Fixed 2 bugs so that RequestDevice() works for non-paired devices (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@test3
Patch Set: scheib fix Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/bluetooth/bluetooth_low_energy_device_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f81fdf7ba745480d662a37c7308d9a3b663a882f 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,8 @@ bool BluetoothLowEnergyDeviceMac::IsConnecting() const {
}
BluetoothDevice::UUIDList BluetoothLowEnergyDeviceMac::GetUUIDs() const {
- return advertised_uuids_;
+ return BluetoothDevice::UUIDList(advertised_uuids_.begin(),
+ advertised_uuids_.end());
}
int16 BluetoothLowEnergyDeviceMac::GetInquiryRSSI() const {
« no previous file with comments | « device/bluetooth/bluetooth_low_energy_device_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698