Skip to content

Commit

Permalink
Fix network commissioning cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Dec 11, 2024
1 parent 9db3dcb commit bf63459
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions src/app/clusters/network-commissioning/network-commissioning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1386,22 +1386,18 @@ bool Instance::AcceptsCommandId(const ConcreteCommandPath & commandPath)
bool Instance::GeneratesCommandId(const ConcreteCommandPath & commandPath)
{
using namespace Clusters::NetworkCommissioning::Commands;

if (mFeatureFlags.HasAny(Feature::kWiFiNetworkInterface, Feature::kThreadNetworkInterface))
switch (commandPath.mCommandId)
{
for (auto && cmd : { ScanNetworksResponse::Id, NetworkConfigResponse::Id, ConnectNetworkResponse::Id })
{
VerifyOrExit(callback(cmd, context) == Loop::Continue, /**/);
}
}
case ScanNetworksResponse::Id:
case NetworkConfigResponse::Id:
case ConnectNetworkResponse::Id:
return mFeatureFlags.HasAny(Feature::kWiFiNetworkInterface, Feature::kThreadNetworkInterface);
case QueryIdentityResponse::Id:

if (mFeatureFlags.Has(Feature::kPerDeviceCredentials))
{
VerifyOrExit(callback(QueryIdentityResponse::Id, context) == Loop::Continue, /**/);
return mFeatureFlags.Has(Feature::kPerDeviceCredentials);
default:
return false;
}

exit:
return CHIP_NO_ERROR;
}

bool NullNetworkDriver::GetEnabled()
Expand Down

0 comments on commit bf63459

Please sign in to comment.