Skip to content

Commit

Permalink
[Silabs][WiFi] CNET 4.4 test step fix for NetworkNotFound (#32729)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
chirag-silabs and restyled-commits authored Mar 28, 2024
1 parent cecc2c3 commit 283c908
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/platform/silabs/NetworkCommissioningWiFiDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,15 @@ void SlWiFiDriver::OnScanWiFiNetworkDone(wfx_wifi_scan_result_t * aScanResult)
{
if (GetInstance().mpScanCallback != nullptr)
{
if (mScanResponseIter.Count() == 0)
{
// if there is no network found, return kNetworkNotFound
DeviceLayer::SystemLayer().ScheduleLambda([]() {
GetInstance().mpScanCallback->OnFinished(NetworkCommissioning::Status::kNetworkNotFound, CharSpan(), nullptr);
GetInstance().mpScanCallback = nullptr;
});
return;
}
DeviceLayer::SystemLayer().ScheduleLambda([]() {
GetInstance().mpScanCallback->OnFinished(NetworkCommissioning::Status::kSuccess, CharSpan(), &mScanResponseIter);
GetInstance().mpScanCallback = nullptr;
Expand Down

0 comments on commit 283c908

Please sign in to comment.