From 528ae4c4e2768839efbe4c6c323b1a8d376f82fe Mon Sep 17 00:00:00 2001 From: Francis Tsui Date: Fri, 14 Mar 2025 13:42:14 -0700 Subject: [PATCH] Fix infinite loop if GATT server fails to start initially. PiperOrigin-RevId: 736972233 --- internal/platform/implementation/windows/ble_gatt_server.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/platform/implementation/windows/ble_gatt_server.cc b/internal/platform/implementation/windows/ble_gatt_server.cc index eb90a02d..12d410af 100644 --- a/internal/platform/implementation/windows/ble_gatt_server.cc +++ b/internal/platform/implementation/windows/ble_gatt_server.cc @@ -451,6 +451,9 @@ bool BleGattServer::StartAdvertisement(const ByteArray& service_data, if (absl::Milliseconds(wait_milliseconds) > kGattServerTimeout) { LOG(ERROR) << __func__ << ": Failed to start GATT advertising due to timeout."; + // GattServiceProvider can become Started after the timeout. Stop + // waiting for the status change and continue as if it has started.. + break; } }