Skip to content

Commit 5379adf

Browse files
committed
Optimize flash cost for optional command in wifi diagnostic cluster
1 parent 2ca3a49 commit 5379adf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ class WiFiDiagosticsGlobalInstance : public AttributeAccessInterface, public Com
6666

6767
void InvokeCommand(HandlerContext & ctx) override;
6868

69+
#ifdef WI_FI_NETWORK_DIAGNOSTICS_ENABLE_RESET_COUNTS_CMD
6970
void HandleResetCounts(HandlerContext & ctx, const Commands::ResetCounts::DecodableType & commandData);
71+
#endif
7072

7173
DiagnosticDataProvider & mDiagnosticProvider;
7274
};
@@ -254,18 +256,22 @@ void WiFiDiagosticsGlobalInstance::InvokeCommand(HandlerContext & handlerContext
254256
{
255257
switch (handlerContext.mRequestPath.mCommandId)
256258
{
259+
#ifdef WI_FI_NETWORK_DIAGNOSTICS_ENABLE_RESET_COUNTS_CMD
257260
case Commands::ResetCounts::Id:
258261
CommandHandlerInterface::HandleCommand<Commands::ResetCounts::DecodableType>(
259262
handlerContext, [this](HandlerContext & ctx, const auto & commandData) { HandleResetCounts(ctx, commandData); });
260263
break;
264+
#endif
261265
}
262266
}
263267

268+
#ifdef WI_FI_NETWORK_DIAGNOSTICS_ENABLE_RESET_COUNTS_CMD
264269
void WiFiDiagosticsGlobalInstance::HandleResetCounts(HandlerContext & ctx, const Commands::ResetCounts::DecodableType & commandData)
265270
{
266271
mDiagnosticProvider.ResetWiFiNetworkDiagnosticsCounts();
267272
ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::Success);
268273
}
274+
#endif
269275

270276
WiFiDiagosticsGlobalInstance gWiFiDiagosticsInstance(DeviceLayer::GetDiagnosticDataProvider());
271277

0 commit comments

Comments
 (0)