Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
【Feature】operational state cluster sdk implementation and example clu…
…ster server application (#26971) * Add operational state cluster implement * Enable operational state cluster server in all-clusters-app.zap * Restyled by clang-format * Restyled by gn * Enable CommandHandlerInterfaceOnlyClusters feature in operational state cluster * Fix the data type no match the operational state cluster xml * Add Uncopyable feature to operational state server class * Fix no define function * Add operational state cluster in other platform * Restyled by clang-format * Restyled by gn * Function / Data Struct in headfile are documented. * Document why operational states to be in storage * document the function note * Add prefix members with m for class OperationalStateServer * Fix Bug: do const_cast no needed * Optimize to returning a const reference * Remove the api no needed to be implemented * use to_underlying to instead static_cast * use reduce_size api to optimize the MutableByteSpan * Fix: memory leak in exceptional situation * Rename the structs for pretty confusing * comment the member * remove the documentation return in functions * Add delete keyword in Uncopyable class * modify the document of functions * modify the document of functions * Fix spelling error in function notes * Fix: memory leak in exceptional situation * Fix: read operational state list or phase list fail in some exception situations * use MakeOptional to optimize the function call * modify the document of functions * Fix: ErrorStateStruct's ErrorStateDetails need to be null/missing * Add the document for function * Optimize ErrorStateStruct's field -- ErrorStateLabel and ErrorStateDetails * document the method signature * document the class * remove temporary variable * Add test cases in TestOperationalStateDataProvider * Remove implementing EnumerateAcceptedCommands in Operational State Cluster * Enable all commands in operational state cluster for all-clusters-app * Zap regen all * Revert file same as master branch * Optimize operational state server's implement * Add operational state delegate implement * Add operational state cluster delegates * Zap regen * Modify path of head file included * add file included in BUILD.gn * Restyled by whitespace * Restyled by clang-format * Restyled by gn * add operational state cluster impl in other platforms * Restyled by gn * Remove log in operational-state-delegate-impl.cpp * remove unuseful file * Update src/app/clusters/operational-state-server/operational-state-delegate.h Co-authored-by: Boris Zbarsky <[email protected]> * Optimize struct GenericOperationalState * drop the extra chip:: in operational-state api * Optimize struct GenericOperationalError * Optimize to put a struct instance on the state, then call the delegate to fill it in * Use GetOperationalStateAtIndex api to instead GetOperationalStateList api * Optimize struct GenericOperationalPhase * Optimize struct GenericOperationalPhase * Optimize HandleXXStateCallback api param * Remove unuseful code and document * Use constexpr val to instead number * Fix use of totalOperationalTime * enable operational state cluster event in Operatinal State cluster * Add unit test of operational state delegate * Add the rest unit test of operational state delegate * Optimize class OperationalStateDelegate , add two private member * move the constexpr val * fix the err in TestOperationalStateDelegate * Optimize api GenericOperationalError * Add OperationalStateDelegateImpl unit test * add document * change Log event api in operational state cluster * Add document * sync code to examples/placeholder * Restyled by whitespace * Restyled by clang-format * Restyled by gn * replace GetOperationalState with GetCurrentOperationalState * update document * update document * update document * replace GetOperationalError with GenericOperationalError * update document * document the api for GetOperationalStateDelegate in head file * optimize the use of operator [] for Span class * fix the spelling error * provide a way to construct a GenericOperationalState without providing a state * optimize the code of if-else * Optimize code * update document * Optimize class OperationalStateServer: put all the public bits together instead of interleaving them with the private bits. * modify document * Add CurrentPhase and CountdownTime attribute into AttributeAccessInterface-only * zap regen * remove unuseful member in class Delegate * remove useful code * document the api * Add set/get current phase api * Add set/get countdownTime api * delegate could be null, and that should be handled without crashing, via returning an error * command callbacks need to respond with an error * remove something that is not in the spec * optimize the name of class member function * Optimize struct GenericOperationCompletion * update struct GenericOperationCompletion test case * Optimize struct GenericOperationCompletion api * add coutdownTime attribute in operational state cluter * change api of initializing OperationalStateServer instances * remove the code using operational state in other platform * Add operational state server init in linux all-cluster-app * Restyled by whitespace * Restyled by clang-format * Restyled by prettier-json * Add TestOperationalState.yaml * rm TestOperationalStateDelegateImpl.cpp * Restyled by whitespace * Restyled by gn * Restyled by prettier-yaml * remove the api, filing a followup issue to emit the right events * fix CI build error * fix CI build err * Restyled by clang-format * fix build error * Restyled by clang-format * update document * use NullOptional to instead Missing * return CHIP_ERROR_INCORRECT_STATE when delegate is nullptr * optimize reading the operational state list * move the position of testcase * fix ci build err * fix ci build err * Restyled by clang-format * fix readability-else-after-return error * fix Unknown key in CI build * add note in ciTest.json for darwin-framework-tool * update document for api * use Zcl instead NotSpecified in log * fix TestOperationalState error * zap_regen_all * optimize lambda function use * Restyled by clang-format * fix ci error: readability-else-after-return --------- Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Justin Wood <[email protected]> Co-authored-by: Boris Zbarsky <[email protected]>
- Loading branch information