-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable op state pause and resume for compatible states (#30795)
* Updated the OpState HandlePauseState method to enable new pause-compatible state to receive this command. * Made OpState unchangable internal variables const. * Updated the OpState HandleResumeState method to enable new resume-compatible states to receive this command. * Restyled by clang-format * Skip resume callback call if state is Running. * Changed the OpState server API such that all derived clusters have their own class. This separetes out the cluster specific logic, reducing the footprint cost. * Added a helper readme that explains how to use and extend the operational state server. * Fixed permissions of the OpState derived cluster methods. * Updated the rvc-app example following the changes to the operational state server API * Updated the all-clusters--app example following the changes to the operational state server API * Restyled by whitespace * Restyled by clang-format * Restyled by prettier-markdown * Updated the dishwasher-app example following the changes to the operational state server API * Restyled by clang-format * Fixed the ameba build of all-clusters-app. * Restyled by clang-format * Fixed the ameba build of all-clusters-app. * Fixed a typo in the operational state server doc. --------- Co-authored-by: Restyled.io <commits@restyled.io>
- Loading branch information
1 parent
81b21b0
commit f08a90e
Showing
9 changed files
with
199 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# The Operational State cluster and its derived clusters | ||
|
||
The Operational State cluster is a normal cluster with ID 0x0060. It is also a | ||
base cluster from with other operational state clusters are derived. | ||
|
||
## How to use an Operational State cluster | ||
|
||
All Operational State derived clusters have their own `Instance` class within | ||
their respective namespace. This class is used to manage the SDK side of the | ||
cluster. This class requires an `OperationalState::Delegate` where the | ||
application specific logic is implemented. | ||
|
||
To use an Operational State cluster | ||
|
||
- Create a class that inherits the `OperationalState::Delegate` class. | ||
- For this class, implement the necessary virtual methods. | ||
- In some translation unit (.c or .cpp file), instantiate the delegate class. | ||
- Instantiate the `Instance` class for your Operational State cluster using | ||
the delegate instance. | ||
- Call the `Init()` method of your instance after the root `Server::Init()`. | ||
- Alternatively, the last two steps can be done in the | ||
`emberAf<ClusterName>ClusterInitCallback` function. | ||
|
||
**Note** Zap accessor functions for these clusters do not exist. Use the | ||
instance's `Set...` and `Get...` functions to access the attributes. | ||
|
||
## How to add new derived clusters | ||
|
||
Once an Operational State derived cluster has been defined in the spec, add the | ||
implementation using the following steps | ||
|
||
1. Translate the spec as an XML in `src/app/zap-templates/zcl/data-model/chip`. | ||
You can look at similar files on how to do this. | ||
2. Regenerate the zap code. | ||
3. Implement an `Instance` class in your cluster's namespace. | ||
4. Extend the all-clusters-app example to include your new cluster. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters