Skip to content

Commit

Permalink
Optimize flash cost for optional command in wifi diagnostic cluster (#…
Browse files Browse the repository at this point in the history
…37283)

* Optimize flash cost for optional command in wifi diagnostic cluster

* Restyled by whitespace

---------

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
yufengwangca and restyled-commits authored Feb 7, 2025
1 parent 9799dce commit a2d94d2
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ class WiFiDiagosticsGlobalInstance : public AttributeAccessInterface, public Com

void InvokeCommand(HandlerContext & ctx) override;

#ifdef WI_FI_NETWORK_DIAGNOSTICS_ENABLE_RESET_COUNTS_CMD
void HandleResetCounts(HandlerContext & ctx, const Commands::ResetCounts::DecodableType & commandData);
#endif

DiagnosticDataProvider & mDiagnosticProvider;
};
Expand Down Expand Up @@ -254,18 +256,22 @@ void WiFiDiagosticsGlobalInstance::InvokeCommand(HandlerContext & handlerContext
{
switch (handlerContext.mRequestPath.mCommandId)
{
#ifdef WI_FI_NETWORK_DIAGNOSTICS_ENABLE_RESET_COUNTS_CMD
case Commands::ResetCounts::Id:
CommandHandlerInterface::HandleCommand<Commands::ResetCounts::DecodableType>(
handlerContext, [this](HandlerContext & ctx, const auto & commandData) { HandleResetCounts(ctx, commandData); });
break;
#endif
}
}

#ifdef WI_FI_NETWORK_DIAGNOSTICS_ENABLE_RESET_COUNTS_CMD
void WiFiDiagosticsGlobalInstance::HandleResetCounts(HandlerContext & ctx, const Commands::ResetCounts::DecodableType & commandData)
{
mDiagnosticProvider.ResetWiFiNetworkDiagnosticsCounts();
ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::Success);
}
#endif

WiFiDiagosticsGlobalInstance gWiFiDiagosticsInstance(DeviceLayer::GetDiagnosticDataProvider());

Expand Down

0 comments on commit a2d94d2

Please sign in to comment.