Skip to content

Commit 283c908

Browse files
[Silabs][WiFi] CNET 4.4 test step fix for NetworkNotFound (#32729)
* adding the network not found fix for cnet * Restyled by clang-format * modifying it to be guard style * Restyled by clang-format --------- Co-authored-by: Restyled.io <[email protected]>
1 parent cecc2c3 commit 283c908

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/platform/silabs/NetworkCommissioningWiFiDriver.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,15 @@ void SlWiFiDriver::OnScanWiFiNetworkDone(wfx_wifi_scan_result_t * aScanResult)
278278
{
279279
if (GetInstance().mpScanCallback != nullptr)
280280
{
281+
if (mScanResponseIter.Count() == 0)
282+
{
283+
// if there is no network found, return kNetworkNotFound
284+
DeviceLayer::SystemLayer().ScheduleLambda([]() {
285+
GetInstance().mpScanCallback->OnFinished(NetworkCommissioning::Status::kNetworkNotFound, CharSpan(), nullptr);
286+
GetInstance().mpScanCallback = nullptr;
287+
});
288+
return;
289+
}
281290
DeviceLayer::SystemLayer().ScheduleLambda([]() {
282291
GetInstance().mpScanCallback->OnFinished(NetworkCommissioning::Status::kSuccess, CharSpan(), &mScanResponseIter);
283292
GetInstance().mpScanCallback = nullptr;

0 commit comments

Comments
 (0)