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

Make EncodableToTLV arguments const #33785

Merged
merged 1 commit into from
Jun 6, 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
4 changes: 2 additions & 2 deletions src/app/CommandHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class CommandHandler
* case AddResponseData fails.
*/
virtual CHIP_ERROR AddResponseData(const ConcreteCommandPath & aRequestCommandPath, CommandId aResponseCommandId,
DataModel::EncodableToTLV & aEncodable) = 0;
const DataModel::EncodableToTLV & aEncodable) = 0;

/**
* Attempts to encode a response to a command.
Expand All @@ -171,7 +171,7 @@ class CommandHandler
* AddResponseData allows the caller to try to deal with any CHIP_ERRORs.
*/
virtual void AddResponse(const ConcreteCommandPath & aRequestCommandPath, CommandId aResponseCommandId,
DataModel::EncodableToTLV & aEncodable) = 0;
const DataModel::EncodableToTLV & aEncodable) = 0;

/**
* Check whether the InvokeRequest we are handling is a timed invoke.
Expand Down
6 changes: 3 additions & 3 deletions src/app/CommandHandlerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Status CommandHandlerImpl::OnInvokeCommandRequest(CommandHandlerExchangeInterfac
}

CHIP_ERROR CommandHandlerImpl::TryAddResponseData(const ConcreteCommandPath & aRequestCommandPath, CommandId aResponseCommandId,
DataModel::EncodableToTLV & aEncodable)
const DataModel::EncodableToTLV & aEncodable)
{
ConcreteCommandPath responseCommandPath = { aRequestCommandPath.mEndpointId, aRequestCommandPath.mClusterId,
aResponseCommandId };
Expand All @@ -134,7 +134,7 @@ CHIP_ERROR CommandHandlerImpl::TryAddResponseData(const ConcreteCommandPath & aR
}

CHIP_ERROR CommandHandlerImpl::AddResponseData(const ConcreteCommandPath & aRequestCommandPath, CommandId aResponseCommandId,
DataModel::EncodableToTLV & aEncodable)
const DataModel::EncodableToTLV & aEncodable)
{
// Return early when response should not be sent out.
VerifyOrReturnValue(ResponsesAccepted(), CHIP_NO_ERROR);
Expand Down Expand Up @@ -909,7 +909,7 @@ bool CommandHandlerImpl::IsTimedInvoke() const
}

void CommandHandlerImpl::AddResponse(const ConcreteCommandPath & aRequestCommandPath, CommandId aResponseCommandId,
DataModel::EncodableToTLV & aEncodable)
const DataModel::EncodableToTLV & aEncodable)
{
CHIP_ERROR err = AddResponseData(aRequestCommandPath, aResponseCommandId, aEncodable);
if (err != CHIP_NO_ERROR)
Expand Down
6 changes: 3 additions & 3 deletions src/app/CommandHandlerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ class CommandHandlerImpl : public CommandHandler
CHIP_ERROR AddClusterSpecificFailure(const ConcreteCommandPath & aRequestCommandPath, ClusterStatus aClusterStatus) override;

CHIP_ERROR AddResponseData(const ConcreteCommandPath & aRequestCommandPath, CommandId aResponseCommandId,
DataModel::EncodableToTLV & aEncodable) override;
const DataModel::EncodableToTLV & aEncodable) override;
void AddResponse(const ConcreteCommandPath & aRequestCommandPath, CommandId aResponseCommandId,
DataModel::EncodableToTLV & aEncodable) override;
const DataModel::EncodableToTLV & aEncodable) override;

Access::SubjectDescriptor GetSubjectDescriptor() const override;
FabricIndex GetAccessingFabricIndex() const override;
Expand Down Expand Up @@ -409,7 +409,7 @@ class CommandHandlerImpl : public CommandHandler
* @param [in] aEncodable the data to encode for the given aResponseCommandId
*/
CHIP_ERROR TryAddResponseData(const ConcreteCommandPath & aRequestCommandPath, CommandId aResponseCommandId,
DataModel::EncodableToTLV & aEncodable);
const DataModel::EncodableToTLV & aEncodable);

void SetExchangeInterface(CommandHandlerExchangeInterface * commandResponder);

Expand Down
Loading