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

Add pre-execution command callback. #20357

Merged
merged 16 commits into from
Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from 13 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
7 changes: 7 additions & 0 deletions src/app/zap-templates/templates/app/callback-stub-src.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,10 @@ void __attribute__((weak)) MatterPostAttributeChangeCallback(
uint8_t type, uint16_t size, uint8_t * value)
{
}

void __attribute__((weak)) MatterPreExecuteCommandCallback(chip::app::CommandHandler * commandObj,
lnikulin marked this conversation as resolved.
Show resolved Hide resolved
const chip::app::ConcreteCommandPath & commandPath)
{
(void)commandObj;
(void)commandPath;
}
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
9 changes: 9 additions & 0 deletions src/app/zap-templates/templates/app/callback.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -423,3 +423,12 @@ chip::Protocols::InteractionModel::Status MatterPreAttributeChangeCallback(const
*/
void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath,
uint8_t type, uint16_t size, uint8_t * value);

/** @brief Pre Execute command callback
* @param commandObj Command object
* @param commandPath Concrete command path to be executed
*
* This function is called by the framework before execute any command
*/
void MatterPreExecuteCommandCallback(chip::app::CommandHandler * commandObj,
const chip::app::ConcreteCommandPath & commandPath);
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP
void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, CommandHandler * apCommandObj)
{
Compatibility::SetupEmberAfCommandHandler(apCommandObj, aCommandPath);

MatterPreExecuteCommandCallback(apCommandObj, aCommandPath);
switch (aCommandPath.mClusterId)
{
{{#all_user_clusters_with_incoming_commands}}
Expand Down