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

Restyle Add pre-execution command callback. #20427

Closed
wants to merge 10 commits into from
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,
const chip::app::ConcreteCommandPath & commandPath)
{
(void)commandObj;
(void)commandPath;
}
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
Loading