Skip to content

Commit 1068312

Browse files
cecillepull[bot]
authored andcommitted
Always search on-network (#12321)
* Always search on-network Nodes that have already been commissioned will always use on-network setup regardless of what is in the setup payload. * Comment from review.
1 parent 8e588fd commit 1068312

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/controller/SetUpCodePairer.cpp

+8-9
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,23 @@ CHIP_ERROR SetUpCodePairer::Connect(RendezvousInformationFlag rendezvousInformat
6262
VerifyOrReturnError(searchOverAll || CHIP_NO_ERROR == err, err);
6363
}
6464

65-
if (searchOverAll || rendezvousInformation == RendezvousInformationFlag::kOnNetwork)
65+
if (searchOverAll || rendezvousInformation == RendezvousInformationFlag::kSoftAP)
6666
{
67-
if (CHIP_NO_ERROR ==
68-
(err = StartDiscoverOverIP(isShort ? static_cast<uint16_t>((discriminator >> 8) & 0x0F) : discriminator, isShort)))
67+
if (CHIP_NO_ERROR == (err = StartDiscoverOverSoftAP(discriminator, isShort)))
6968
{
7069
isRunning = true;
7170
}
7271
VerifyOrReturnError(searchOverAll || CHIP_NO_ERROR == err, err);
7372
}
7473

75-
if (searchOverAll || rendezvousInformation == RendezvousInformationFlag::kSoftAP)
74+
// We always want to search on network because any node that has already been commissioned will use on-network regardless of the
75+
// QR code flag.
76+
if (CHIP_NO_ERROR ==
77+
(err = StartDiscoverOverIP(isShort ? static_cast<uint16_t>((discriminator >> 8) & 0x0F) : discriminator, isShort)))
7678
{
77-
if (CHIP_NO_ERROR == (err = StartDiscoverOverSoftAP(discriminator, isShort)))
78-
{
79-
isRunning = true;
80-
}
81-
VerifyOrReturnError(searchOverAll || CHIP_NO_ERROR == err, err);
79+
isRunning = true;
8280
}
81+
VerifyOrReturnError(searchOverAll || CHIP_NO_ERROR == err, err);
8382

8483
return isRunning ? CHIP_NO_ERROR : CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
8584
}

0 commit comments

Comments
 (0)