Skip to content

Commit

Permalink
Comments update
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed May 27, 2024
1 parent a32fb0c commit 46d905a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/app/CommandHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ class EncoderToTLV

virtual CHIP_ERROR Encode(TLV::TLVWriter &, TLV::Tag tag) = 0;
};
/// Defines an abstract class of something that can be encoded
/// into a TLV with a given data tag

/// An `EncoderToTLV` the uses `DataModel::Encode` to encode things.
///
/// Generally useful to encode things like <ClusterName>::Commands::<CommandName>::Type
/// structures.
template <typename T>
class DataModelEncoderToTLV : public EncoderToTLV
{
Expand Down Expand Up @@ -349,6 +351,8 @@ class CommandHandler
* @param [in] aRequestCommandPath the concrete path of the command we are
* responding to.
* @param [in] aData the data for the response.
*
* NOTE: this is a convenience function for `AddResponseDataViaEncoder`
*/
template <typename CommandData>
inline CHIP_ERROR AddResponseData(const ConcreteCommandPath & aRequestCommandPath, const CommandData & aData)
Expand All @@ -365,7 +369,11 @@ class CommandHandler
* @param [in] aRequestCommandPath the concrete path of the command we are
* responding to.
* @param [in] commandId the command whose content is being encoded.
* @param [in] aData the data for the response.
* @param [in] encoder - an encoder that places the command data structure for `commandId`
* into a TLV Writer.
*
* Most applications are likely to use `AddResponseData` as a more convenient
* one-call that auto-sets command ID and creates the underlying encoders.
*/
CHIP_ERROR AddResponseDataViaEncoder(const ConcreteCommandPath & aRequestCommandPath, CommandId commandId,
EncoderToTLV & encoder)
Expand Down

0 comments on commit 46d905a

Please sign in to comment.