From e0a17f898e65992ec840e1bab143c99a6625644c Mon Sep 17 00:00:00 2001 From: Cecille Freeman Date: Mon, 29 Nov 2021 11:06:20 -0500 Subject: [PATCH 1/2] Always search on-network Nodes that have already been commissioned will always use on-network setup regardless of what is in the setup payload. --- src/controller/SetUpCodePairer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controller/SetUpCodePairer.cpp b/src/controller/SetUpCodePairer.cpp index f4b7ac3ae6cfba..e4b4b4989a4fd1 100644 --- a/src/controller/SetUpCodePairer.cpp +++ b/src/controller/SetUpCodePairer.cpp @@ -62,7 +62,8 @@ CHIP_ERROR SetUpCodePairer::Connect(RendezvousInformationFlag rendezvousInformat VerifyOrReturnError(searchOverAll || CHIP_NO_ERROR == err, err); } - if (searchOverAll || rendezvousInformation == RendezvousInformationFlag::kOnNetwork) + // We always want to search on network because any node that has already been commissioned will use on-network regardless of the + // QR code flag. { if (CHIP_NO_ERROR == (err = StartDiscoverOverIP(discriminator, isShort))) { From b1b095e2e26f2ab3956a07a7059ccfa1a3637ced Mon Sep 17 00:00:00 2001 From: Cecille Freeman Date: Tue, 30 Nov 2021 12:10:10 -0500 Subject: [PATCH 2/2] Comment from review. --- src/controller/SetUpCodePairer.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/controller/SetUpCodePairer.cpp b/src/controller/SetUpCodePairer.cpp index e4b4b4989a4fd1..bae96b76cd3a16 100644 --- a/src/controller/SetUpCodePairer.cpp +++ b/src/controller/SetUpCodePairer.cpp @@ -62,24 +62,22 @@ CHIP_ERROR SetUpCodePairer::Connect(RendezvousInformationFlag rendezvousInformat VerifyOrReturnError(searchOverAll || CHIP_NO_ERROR == err, err); } - // We always want to search on network because any node that has already been commissioned will use on-network regardless of the - // QR code flag. + if (searchOverAll || rendezvousInformation == RendezvousInformationFlag::kSoftAP) { - if (CHIP_NO_ERROR == (err = StartDiscoverOverIP(discriminator, isShort))) + if (CHIP_NO_ERROR == (err = StartDiscoverOverSoftAP(discriminator, isShort))) { isRunning = true; } VerifyOrReturnError(searchOverAll || CHIP_NO_ERROR == err, err); } - if (searchOverAll || rendezvousInformation == RendezvousInformationFlag::kSoftAP) + // We always want to search on network because any node that has already been commissioned will use on-network regardless of the + // QR code flag. + if (CHIP_NO_ERROR == (err = StartDiscoverOverIP(discriminator, isShort))) { - if (CHIP_NO_ERROR == (err = StartDiscoverOverSoftAP(discriminator, isShort))) - { - isRunning = true; - } - VerifyOrReturnError(searchOverAll || CHIP_NO_ERROR == err, err); + isRunning = true; } + VerifyOrReturnError(searchOverAll || CHIP_NO_ERROR == err, err); return isRunning ? CHIP_NO_ERROR : CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; }