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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_service_mac.mm

Issue 2595373003: Bluetooth: mac: Working on macOS descriptor implementation. (Closed)
Patch Set: Fixes Created 3 years, 11 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') | device/bluetooth/test/bluetooth_test_mac.h » ('j') | 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 ca8ac7e06ef7da5c5d4413b28f648e4b8f48f244..505321e6aa15a60eb11cd9cf1f988f6c3a5d2d3d 100644
--- a/device/bluetooth/bluetooth_remote_gatt_service_mac.mm
+++ b/device/bluetooth/bluetooth_remote_gatt_service_mac.mm
@@ -95,6 +95,7 @@ void BluetoothRemoteGattServiceMac::DidDiscoverCharacteristics() {
if (gatt_characteristic_mac) {
const std::string& identifier = gatt_characteristic_mac->GetIdentifier();
characteristic_identifier_to_remove.erase(identifier);
+ gatt_characteristic_mac->DiscoverDescriptors();
continue;
}
gatt_characteristic_mac =
@@ -103,6 +104,7 @@ void BluetoothRemoteGattServiceMac::DidDiscoverCharacteristics() {
auto result_iter = gatt_characteristic_macs_.insert(
{identifier, base::WrapUnique(gatt_characteristic_mac)});
DCHECK(result_iter.second);
+ gatt_characteristic_mac->DiscoverDescriptors();
GetMacAdapter()->NotifyGattCharacteristicAdded(gatt_characteristic_mac);
}
@@ -118,6 +120,16 @@ void BluetoothRemoteGattServiceMac::DidDiscoverCharacteristics() {
SendNotificationIfComplete();
}
+void BluetoothRemoteGattServiceMac::DidDiscoverDescriptors(
+ CBCharacteristic* characteristic) {
+ DCHECK(!is_discovery_complete_);
+ BluetoothRemoteGattCharacteristicMac* gatt_characteristic =
+ GetBluetoothRemoteGattCharacteristicMac(characteristic);
+ DCHECK(gatt_characteristic);
+ gatt_characteristic->DidDiscoverDescriptors();
+ SendNotificationIfComplete();
+}
+
void BluetoothRemoteGattServiceMac::SendNotificationIfComplete() {
DCHECK(!is_discovery_complete_);
// Notify when all characteristics have been fully discovered.
« no previous file with comments | « device/bluetooth/bluetooth_remote_gatt_service_mac.h ('k') | device/bluetooth/test/bluetooth_test_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698