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

Feature: Change callback in a command (CON-730) #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Diegorro98
Copy link
Contributor

Callback change in a command can be useful in some scenarios where other functionality different from the original is required. Just like the possibility that already exist to override the callback for an attribute.

@chiragatal
Copy link
Contributor

Out of curiosity, can you give an example where this is helpful?

From my understanding (by looking at the IMClusterCommandHandler.cpp file), for the standard commands, the API which needs to be eventually called was very specific (example emberAfOnOffClusterOnCallback) and this API was implemented in Matter's cluster code.

@chiragatal
Copy link
Contributor

I am also wondering if a COMMAND_FLAG_OVERRIDE needs to be added, similar to the ATTRIBUTE_FLAG_OVERRIDE, and if that will be useful when calling this callback.

Currently, in esp-matter, for commands with COMMAND_FLAG_CUSTOM, the default response is sent internally based on the return value from the callback.

@Diegorro98
Copy link
Contributor Author

Out of curiosity, can you give an example where this is helpful?

From my understanding (by looking at the IMClusterCommandHandler.cpp file), for the standard commands, the API which needs to be eventually called was very specific (example emberAfOnOffClusterOnCallback) and this API was implemented in Matter's cluster code.

Sure, it might be helpful when the Matter's cluster code doesn't satisfy the needs or isn't very flexible.

@CLAassistant
Copy link

CLAassistant commented Sep 22, 2022

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot changed the title Feature: Change callback in a command Feature: Change callback in a command (CON-730) Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants