Log how many peripheral devices lost

PiperOrigin-RevId: 689141285
This commit is contained in:
Guogang Li
2024-10-23 16:18:55 -07:00
committed by Copybara-Service
parent df6c4fadef
commit e875eeffde
@@ -219,6 +219,7 @@ bool DiscoveredPeripheralTracker::HandleOnLostAdvertisementLocked(
void DiscoveredPeripheralTracker::ProcessLostGattAdvertisements() {
MutexLock lock(&mutex_);
int lost_count = 0;
for (auto& it : service_id_infos_) {
const std::string& service_id = it.first;
@@ -238,11 +239,15 @@ void DiscoveredPeripheralTracker::ProcessLostGattAdvertisements() {
std::move(lost_peripheral), service_id,
gatt_advertisement.GetData(),
gatt_advertisement.IsFastAdvertisement());
++lost_count;
}
}
ClearGattAdvertisement(gatt_advertisement);
}
}
LOG(INFO) << __func__ << ": Lost " << lost_count
<< " GATT advertisements due to peripheral timeout.";
}
void DiscoveredPeripheralTracker::ClearDataForServiceId(