Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up unused ember callback from soft diagnostic cluster #36910

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1226,43 +1226,6 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP

} // namespace SmokeCoAlarm

namespace SoftwareDiagnostics {

void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv)
{
CHIP_ERROR TLVError = CHIP_NO_ERROR;
bool wasHandled = false;
{
switch (aCommandPath.mCommandId)
{
case Commands::ResetWatermarks::Id: {
Commands::ResetWatermarks::DecodableType commandData;
TLVError = DataModel::Decode(aDataTlv, commandData);
if (TLVError == CHIP_NO_ERROR)
{
wasHandled = emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(apCommandObj, aCommandPath, commandData);
}
break;
}
default: {
// Unrecognized command ID, error status will apply.
apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand);
ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI,
ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId));
return;
}
}
}

if (CHIP_NO_ERROR != TLVError || !wasHandled)
{
apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand);
ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format());
}
}

} // namespace SoftwareDiagnostics

namespace TemperatureControl {

void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv)
Expand Down Expand Up @@ -1935,9 +1898,6 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV:
case Clusters::SmokeCoAlarm::Id:
Clusters::SmokeCoAlarm::DispatchServerCommand(apCommandObj, aCommandPath, aReader);
break;
case Clusters::SoftwareDiagnostics::Id:
Clusters::SoftwareDiagnostics::DispatchServerCommand(apCommandObj, aCommandPath, aReader);
break;
case Clusters::TemperatureControl::Id:
Clusters::TemperatureControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -930,43 +930,6 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP

} // namespace OperationalCredentials

namespace SoftwareDiagnostics {

void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv)
{
CHIP_ERROR TLVError = CHIP_NO_ERROR;
bool wasHandled = false;
{
switch (aCommandPath.mCommandId)
{
case Commands::ResetWatermarks::Id: {
Commands::ResetWatermarks::DecodableType commandData;
TLVError = DataModel::Decode(aDataTlv, commandData);
if (TLVError == CHIP_NO_ERROR)
{
wasHandled = emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(apCommandObj, aCommandPath, commandData);
}
break;
}
default: {
// Unrecognized command ID, error status will apply.
apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand);
ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI,
ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId));
return;
}
}
}

if (CHIP_NO_ERROR != TLVError || !wasHandled)
{
apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand);
ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format());
}
}

} // namespace SoftwareDiagnostics

namespace ThreadNetworkDiagnostics {

void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv)
Expand Down Expand Up @@ -1083,9 +1046,6 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV:
case Clusters::OperationalCredentials::Id:
Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandPath, aReader);
break;
case Clusters::SoftwareDiagnostics::Id:
Clusters::SoftwareDiagnostics::DispatchServerCommand(apCommandObj, aCommandPath, aReader);
break;
case Clusters::ThreadNetworkDiagnostics::Id:
Clusters::ThreadNetworkDiagnostics::DispatchServerCommand(apCommandObj, aCommandPath, aReader);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,6 @@ void SoftwareDiagnosticsServer::OnSoftwareFaultDetect(const SoftwareDiagnostics:
} // namespace app
} // namespace chip

bool emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(app::CommandHandler * commandObj,
const app::ConcreteCommandPath & commandPath,
const Commands::ResetWatermarks::DecodableType & commandData)
{
// Shouldn't be called at all.
return false;
}

void MatterSoftwareDiagnosticsPluginServerInitCallback()
{
AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess);
Expand Down
1 change: 1 addition & 0 deletions src/app/common/templates/config-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ CommandHandlerInterfaceOnlyClusters:
- Water Heater Management
- Water Heater Mode
- General Commissioning
- Software Diagnostics

# We need a more configurable way of deciding which clusters have which init functions....
# See https://github.com/project-chip/connectedhomeip/issues/4369
Expand Down
6 changes: 0 additions & 6 deletions zzz_generated/app-common/app-common/zap-generated/callback.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading