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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_service_mac.mm

Issue 2907033002: Bluetooth: macOS: Making code to get mac descriptors more coherent (Closed)
Patch Set: Merge Created 3 years, 6 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_remote_gatt_service_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_remote_gatt_service_mac.mm
diff --git a/device/bluetooth/bluetooth_remote_gatt_service_mac.mm b/device/bluetooth/bluetooth_remote_gatt_service_mac.mm
index a7bbeee2b5fd6e0b1b3806f6ecc511aadc9b44f6..613f4dce767eab387903747bcc1b9eb2cc288702 100644
--- a/device/bluetooth/bluetooth_remote_gatt_service_mac.mm
+++ b/device/bluetooth/bluetooth_remote_gatt_service_mac.mm
@@ -192,14 +192,14 @@ CBService* BluetoothRemoteGattServiceMac::GetService() const {
BluetoothRemoteGattCharacteristicMac*
BluetoothRemoteGattServiceMac::GetBluetoothRemoteGattCharacteristicMac(
- CBCharacteristic* characteristic) const {
+ CBCharacteristic* cb_characteristic) const {
auto found = std::find_if(
gatt_characteristic_macs_.begin(), gatt_characteristic_macs_.end(),
- [characteristic](
+ [cb_characteristic](
const std::pair<
const std::string,
std::unique_ptr<BluetoothRemoteGattCharacteristicMac>>& pair) {
- return pair.second->GetCBCharacteristic() == characteristic;
+ return pair.second->GetCBCharacteristic() == cb_characteristic;
});
if (found == gatt_characteristic_macs_.end()) {
return nullptr;
@@ -208,6 +208,19 @@ BluetoothRemoteGattServiceMac::GetBluetoothRemoteGattCharacteristicMac(
}
}
+BluetoothRemoteGattDescriptorMac*
+BluetoothRemoteGattServiceMac::GetBluetoothRemoteGattDescriptorMac(
+ CBDescriptor* cb_descriptor) const {
+ CBCharacteristic* cb_characteristic = [cb_descriptor characteristic];
+ BluetoothRemoteGattCharacteristicMac* gatt_characteristic_mac =
+ GetBluetoothRemoteGattCharacteristicMac(cb_characteristic);
+ if (!gatt_characteristic_mac) {
+ return nullptr;
+ }
+ return gatt_characteristic_mac->GetBluetoothRemoteGattDescriptorMac(
+ cb_descriptor);
+}
+
DEVICE_BLUETOOTH_EXPORT std::ostream& operator<<(
std::ostream& out,
const BluetoothRemoteGattServiceMac& service) {
« no previous file with comments | « device/bluetooth/bluetooth_remote_gatt_service_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698