Skip to content

Commit 3a931d6

Browse files
authored
Clean up unused ember callback from soft diagnostic cluster (#36910)
1 parent 388be5b commit 3a931d6

File tree

5 files changed

+1
-94
lines changed

5 files changed

+1
-94
lines changed

scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/IMClusterCommandHandler.cpp

-40
Original file line numberDiff line numberDiff line change
@@ -1226,43 +1226,6 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP
12261226

12271227
} // namespace SmokeCoAlarm
12281228

1229-
namespace SoftwareDiagnostics {
1230-
1231-
void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv)
1232-
{
1233-
CHIP_ERROR TLVError = CHIP_NO_ERROR;
1234-
bool wasHandled = false;
1235-
{
1236-
switch (aCommandPath.mCommandId)
1237-
{
1238-
case Commands::ResetWatermarks::Id: {
1239-
Commands::ResetWatermarks::DecodableType commandData;
1240-
TLVError = DataModel::Decode(aDataTlv, commandData);
1241-
if (TLVError == CHIP_NO_ERROR)
1242-
{
1243-
wasHandled = emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(apCommandObj, aCommandPath, commandData);
1244-
}
1245-
break;
1246-
}
1247-
default: {
1248-
// Unrecognized command ID, error status will apply.
1249-
apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand);
1250-
ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI,
1251-
ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId));
1252-
return;
1253-
}
1254-
}
1255-
}
1256-
1257-
if (CHIP_NO_ERROR != TLVError || !wasHandled)
1258-
{
1259-
apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand);
1260-
ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format());
1261-
}
1262-
}
1263-
1264-
} // namespace SoftwareDiagnostics
1265-
12661229
namespace TemperatureControl {
12671230

12681231
void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv)
@@ -1935,9 +1898,6 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV:
19351898
case Clusters::SmokeCoAlarm::Id:
19361899
Clusters::SmokeCoAlarm::DispatchServerCommand(apCommandObj, aCommandPath, aReader);
19371900
break;
1938-
case Clusters::SoftwareDiagnostics::Id:
1939-
Clusters::SoftwareDiagnostics::DispatchServerCommand(apCommandObj, aCommandPath, aReader);
1940-
break;
19411901
case Clusters::TemperatureControl::Id:
19421902
Clusters::TemperatureControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader);
19431903
break;

scripts/tools/zap/tests/outputs/lighting-app/app-templates/IMClusterCommandHandler.cpp

-40
Original file line numberDiff line numberDiff line change
@@ -930,43 +930,6 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP
930930

931931
} // namespace OperationalCredentials
932932

933-
namespace SoftwareDiagnostics {
934-
935-
void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv)
936-
{
937-
CHIP_ERROR TLVError = CHIP_NO_ERROR;
938-
bool wasHandled = false;
939-
{
940-
switch (aCommandPath.mCommandId)
941-
{
942-
case Commands::ResetWatermarks::Id: {
943-
Commands::ResetWatermarks::DecodableType commandData;
944-
TLVError = DataModel::Decode(aDataTlv, commandData);
945-
if (TLVError == CHIP_NO_ERROR)
946-
{
947-
wasHandled = emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(apCommandObj, aCommandPath, commandData);
948-
}
949-
break;
950-
}
951-
default: {
952-
// Unrecognized command ID, error status will apply.
953-
apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand);
954-
ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI,
955-
ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId));
956-
return;
957-
}
958-
}
959-
}
960-
961-
if (CHIP_NO_ERROR != TLVError || !wasHandled)
962-
{
963-
apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand);
964-
ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format());
965-
}
966-
}
967-
968-
} // namespace SoftwareDiagnostics
969-
970933
namespace ThreadNetworkDiagnostics {
971934

972935
void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv)
@@ -1083,9 +1046,6 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV:
10831046
case Clusters::OperationalCredentials::Id:
10841047
Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandPath, aReader);
10851048
break;
1086-
case Clusters::SoftwareDiagnostics::Id:
1087-
Clusters::SoftwareDiagnostics::DispatchServerCommand(apCommandObj, aCommandPath, aReader);
1088-
break;
10891049
case Clusters::ThreadNetworkDiagnostics::Id:
10901050
Clusters::ThreadNetworkDiagnostics::DispatchServerCommand(apCommandObj, aCommandPath, aReader);
10911051
break;

src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,6 @@ void SoftwareDiagnosticsServer::OnSoftwareFaultDetect(const SoftwareDiagnostics:
220220
} // namespace app
221221
} // namespace chip
222222

223-
bool emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(app::CommandHandler * commandObj,
224-
const app::ConcreteCommandPath & commandPath,
225-
const Commands::ResetWatermarks::DecodableType & commandData)
226-
{
227-
// Shouldn't be called at all.
228-
return false;
229-
}
230-
231223
void MatterSoftwareDiagnosticsPluginServerInitCallback()
232224
{
233225
AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess);

src/app/common/templates/config-data.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ CommandHandlerInterfaceOnlyClusters:
5050
- Water Heater Management
5151
- Water Heater Mode
5252
- General Commissioning
53+
- Software Diagnostics
5354

5455
# We need a more configurable way of deciding which clusters have which init functions....
5556
# See https://github.com/project-chip/connectedhomeip/issues/4369

zzz_generated/app-common/app-common/zap-generated/callback.h

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)