From 64b2ca439e1b347890d7de1743b09e59bf58049d Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 13 Dec 2022 18:11:10 +0100 Subject: [PATCH] [SetuopCodePairer] Add a comment to explain why device discovered over BLE are using emplace_front and not emplace_back (#24058) --- src/controller/SetUpCodePairer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/controller/SetUpCodePairer.cpp b/src/controller/SetUpCodePairer.cpp index d9a372f3d025be..57ea06ed403e31 100644 --- a/src/controller/SetUpCodePairer.cpp +++ b/src/controller/SetUpCodePairer.cpp @@ -272,6 +272,12 @@ void SetUpCodePairer::OnDiscoveredDeviceOverBle(BLE_CONNECTION_OBJECT connObj) mWaitingForDiscovery[kBLETransport] = false; + // In order to not wait for all the possible addresses discovered over mdns to + // be tried before trying to connect over BLE, the discovered connection object is + // inserted at the beginning of the list. + // + // It makes it the 'next' thing to try to connect to if there are already some + // discovered parameters in the list. mDiscoveredParameters.emplace_front(connObj); ConnectToDiscoveredDevice(); }