Skip to content

Commit d14e38b

Browse files
committed
Argument renaming and comment update
1 parent fa7441b commit d14e38b

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/app/CommandHandler.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,16 @@ Status CommandHandler::OnInvokeCommandRequest(CommandHandlerExchangeInterface &
113113
return status;
114114
}
115115

116+
CHIP_ERROR CommandHandler::TryAddResponseData(const ConcreteCommandPath & path, CommandId commandId, EncoderToTLV & encoder)
117+
{
118+
ConcreteCommandPath responseCommandPath = { path.mEndpointId, path.mClusterId, commandId };
119+
ReturnErrorOnFailure(TryAddResponseDataPreEncode(path, responseCommandPath));
120+
TLV::TLVWriter * writer = GetCommandDataIBTLVWriter();
121+
VerifyOrReturnError(writer != nullptr, CHIP_ERROR_INCORRECT_STATE);
122+
ReturnErrorOnFailure(encoder.Encode(*writer, TLV::ContextTag(CommandDataIB::Tag::kFields)));
123+
return FinishCommand(/* aEndDataStruct = */ false);
124+
}
125+
116126
CHIP_ERROR CommandHandler::ValidateInvokeRequestMessageAndBuildRegistry(InvokeRequestMessage::Parser & invokeRequestMessage)
117127
{
118128
CHIP_ERROR err = CHIP_NO_ERROR;

src/app/CommandHandler.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -696,11 +696,11 @@ class CommandHandler
696696
* Callers should snapshot as needed before calling this function, and roll back
697697
* as needed afterward.
698698
*
699-
* @param [in] aRequestCommandPath the concrete path of the command we are
700-
* responding to.
701-
* @param [in] aData the data for the response.
699+
* @param [in] path the concrete path of the command we are responding to
700+
* @param [in] commandId the id of the command to encode
701+
* @param [in] encoder the data to encode for the given commandId
702702
*/
703-
CHIP_ERROR TryAddResponseData(const ConcreteCommandPath & aRequestCommandPath, CommandId commandId, EncoderToTLV & encoder);
703+
CHIP_ERROR TryAddResponseData(const ConcreteCommandPath & path, CommandId commandId, EncoderToTLV & encoder);
704704

705705
void SetExchangeInterface(CommandHandlerExchangeInterface * commandResponder);
706706

0 commit comments

Comments
 (0)