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】operational state cluster sdk implementation and example cluster server application #26971

Merged
Show file tree
Hide file tree
Changes from 151 commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
3a7fe49
Add operational state cluster implement
mideayanghui May 23, 2023
8c1034c
Enable operational state cluster server in all-clusters-app.zap
mideayanghui May 31, 2023
e700864
Restyled by clang-format
restyled-commits May 23, 2023
51bd3fc
Restyled by gn
restyled-commits May 23, 2023
5811712
Enable CommandHandlerInterfaceOnlyClusters feature in operational sta…
mideayanghui May 31, 2023
3efdfb7
Fix the data type no match the operational state cluster xml
mideayanghui May 31, 2023
3af2c9c
Add Uncopyable feature to operational state server class
mideayanghui May 31, 2023
7ccece0
Fix no define function
mideayanghui May 31, 2023
661839f
Add operational state cluster in other platform
mideayanghui May 31, 2023
72f508e
Restyled by clang-format
restyled-commits May 31, 2023
a49a790
Restyled by gn
restyled-commits May 31, 2023
54551a5
Merge feature/operational-state-cluster-sdk-impl-1 to master branch
mideayanghui Jun 7, 2023
5effcc4
Function / Data Struct in headfile are documented.
mideayanghui Jun 7, 2023
b1ef71f
Document why operational states to be in storage
mideayanghui Jun 7, 2023
4d91e03
Merge branch 'master' into feature/operational-state-cluster-sdk-impl-1
mideayanghui Jun 8, 2023
b6f7b5b
document the function note
mideayanghui Jun 8, 2023
7d18ff0
Add prefix members with m for class OperationalStateServer
mideayanghui Jun 8, 2023
5705f8e
Fix Bug: do const_cast no needed
mideayanghui Jun 8, 2023
a5580b3
Optimize to returning a const reference
mideayanghui Jun 8, 2023
7d963b1
Remove the api no needed to be implemented
mideayanghui Jun 8, 2023
dd429f0
use to_underlying to instead static_cast
mideayanghui Jun 8, 2023
6605dce
use reduce_size api to optimize the MutableByteSpan
mideayanghui Jun 12, 2023
b662c00
Fix: memory leak in exceptional situation
mideayanghui Jun 12, 2023
88e4fb6
Rename the structs for pretty confusing
mideayanghui Jun 12, 2023
6d54121
comment the member
mideayanghui Jun 12, 2023
60d9a99
remove the documentation return in functions
mideayanghui Jun 12, 2023
4672bb9
Add delete keyword in Uncopyable class
mideayanghui Jun 12, 2023
8501c92
modify the document of functions
mideayanghui Jun 12, 2023
3b3ba4b
modify the document of functions
mideayanghui Jun 12, 2023
3212f2c
Fix spelling error in function notes
mideayanghui Jun 12, 2023
08abcc1
Fix: memory leak in exceptional situation
mideayanghui Jun 12, 2023
086da06
Fix: read operational state list or phase list fail in some exception…
mideayanghui Jun 12, 2023
9100778
use MakeOptional to optimize the function call
mideayanghui Jun 12, 2023
6db21d6
modify the document of functions
mideayanghui Jun 12, 2023
0e25479
Fix: ErrorStateStruct's ErrorStateDetails need to be null/missing
mideayanghui Jun 12, 2023
9857637
Add the document for function
mideayanghui Jun 13, 2023
998cb23
Optimize ErrorStateStruct's field -- ErrorStateLabel and ErrorStateDe…
mideayanghui Jun 13, 2023
6687b97
document the method signature
mideayanghui Jun 13, 2023
16b4c8c
document the class
mideayanghui Jun 13, 2023
8fb6899
remove temporary variable
mideayanghui Jun 16, 2023
5c1c597
Add test cases in TestOperationalStateDataProvider
mideayanghui Jun 16, 2023
f5fb324
Remove implementing EnumerateAcceptedCommands in Operational State Cl…
mideayanghui Jun 16, 2023
11c6754
Enable all commands in operational state cluster for all-clusters-app
mideayanghui Jun 16, 2023
398d413
Merge feature/operational-state-cluster-sdk-impl-1 branch into master…
mideayanghui Jun 16, 2023
f2f71b2
Zap regen all
mideayanghui Jun 16, 2023
033e76a
merge feature/operational-state-cluster-sdk-impl-1 to master branch
mideayanghui Jun 21, 2023
454c3d2
Revert file same as master branch
mideayanghui Jun 21, 2023
1a3fc60
Optimize operational state server's implement
mideayanghui Jun 21, 2023
2361ec7
Add operational state delegate implement
mideayanghui Jun 21, 2023
61a557d
Add operational state cluster delegates
mideayanghui Jun 21, 2023
3adca73
Zap regen
mideayanghui Jun 21, 2023
011ef47
Modify path of head file included
mideayanghui Jun 21, 2023
ef0a05c
add file included in BUILD.gn
mideayanghui Jun 21, 2023
149a67c
Restyled by whitespace
restyled-commits Jun 21, 2023
2d81d51
Restyled by clang-format
restyled-commits Jun 21, 2023
b8fe441
Restyled by gn
restyled-commits Jun 21, 2023
af86ed0
add operational state cluster impl in other platforms
mideayanghui Jun 21, 2023
f9d1153
Merge branch 'master' into feature/operational-state-cluster-sdk-impl-1
mideayanghui Jun 21, 2023
5b29618
Restyled by gn
restyled-commits Jun 21, 2023
5b3f50f
Remove log in operational-state-delegate-impl.cpp
mideayanghui Jun 21, 2023
b100e34
remove unuseful file
mideayanghui Jun 21, 2023
2c07570
Update src/app/clusters/operational-state-server/operational-state-de…
woody-apple Jun 21, 2023
4b1429b
Optimize struct GenericOperationalState
mideayanghui Jun 26, 2023
b01f43c
drop the extra chip:: in operational-state api
mideayanghui Jun 26, 2023
a69b842
Optimize struct GenericOperationalError
mideayanghui Jun 26, 2023
044f7eb
Optimize to put a struct instance on the state, then call the delegat…
mideayanghui Jun 26, 2023
51d48c4
Use GetOperationalStateAtIndex api to instead GetOperationalStateLis…
mideayanghui Jun 26, 2023
97a057c
Optimize struct GenericOperationalPhase
mideayanghui Jun 26, 2023
1fe7d86
Optimize struct GenericOperationalPhase
mideayanghui Jun 27, 2023
26d720c
Optimize HandleXXStateCallback api param
mideayanghui Jun 27, 2023
2132f70
Remove unuseful code and document
mideayanghui Jun 27, 2023
9b919ce
Use constexpr val to instead number
mideayanghui Jun 27, 2023
4461d67
Fix use of totalOperationalTime
mideayanghui Jun 27, 2023
8d599cf
enable operational state cluster event in Operatinal State cluster
mideayanghui Jun 27, 2023
c2b0643
Add unit test of operational state delegate
mideayanghui Jun 27, 2023
77c96b2
Add the rest unit test of operational state delegate
mideayanghui Jun 28, 2023
44126ca
Optimize class OperationalStateDelegate , add two private member
mideayanghui Jun 28, 2023
5d9f5a3
move the constexpr val
mideayanghui Jun 28, 2023
837fa6f
fix the err in TestOperationalStateDelegate
mideayanghui Jun 28, 2023
b3a8796
Optimize api GenericOperationalError
mideayanghui Jun 28, 2023
9c44334
Add OperationalStateDelegateImpl unit test
mideayanghui Jun 28, 2023
dca4cc3
add document
mideayanghui Jun 28, 2023
857b85a
change Log event api in operational state cluster
mideayanghui Jun 28, 2023
615c9f5
Add document
mideayanghui Jun 28, 2023
bd75e83
sync code to examples/placeholder
mideayanghui Jun 28, 2023
fc8479e
merge master branch to feature/operational-state-cluster-sdk-impl-1 b…
mideayanghui Jun 28, 2023
c27eb11
Merge branch 'feature/operational-state-cluster-sdk-impl-3' into feat…
mideayanghui Jun 28, 2023
1dd547e
Restyled by whitespace
restyled-commits Jun 28, 2023
5c5918a
Restyled by clang-format
restyled-commits Jun 28, 2023
c3edc9e
Restyled by gn
restyled-commits Jun 28, 2023
116b8ea
Merge branch 'master' into feature/operational-state-cluster-sdk-impl-1
mideayanghui Jul 3, 2023
9b7e430
replace GetOperationalState with GetCurrentOperationalState
mideayanghui Jul 3, 2023
1aaa069
update document
mideayanghui Jul 3, 2023
6f2e063
update document
mideayanghui Jul 3, 2023
b47c213
update document
mideayanghui Jul 3, 2023
2e70c78
replace GetOperationalError with GenericOperationalError
mideayanghui Jul 3, 2023
dbd0d14
update document
mideayanghui Jul 3, 2023
3cc711c
document the api for GetOperationalStateDelegate in head file
mideayanghui Jul 3, 2023
e21646e
optimize the use of operator [] for Span class
mideayanghui Jul 3, 2023
448ac11
fix the spelling error
mideayanghui Jul 3, 2023
616cd09
provide a way to construct a GenericOperationalState without providi…
mideayanghui Jul 3, 2023
f5dc412
optimize the code of if-else
mideayanghui Jul 3, 2023
85c3fb2
Optimize code
mideayanghui Jul 4, 2023
84026c0
update document
mideayanghui Jul 4, 2023
37d027d
Optimize class OperationalStateServer:
mideayanghui Jul 4, 2023
c81535b
modify document
mideayanghui Jul 4, 2023
fe4440b
Merge branch 'master' into feature/operational-state-cluster-sdk-impl-1
mideayanghui Jul 4, 2023
fed1ecd
Add CurrentPhase and CountdownTime attribute into AttributeAccessInte…
mideayanghui Jul 4, 2023
557124d
zap regen
mideayanghui Jul 4, 2023
359ee95
remove unuseful member in class Delegate
mideayanghui Jul 4, 2023
b5c8464
remove useful code
mideayanghui Jul 4, 2023
ba7a931
document the api
mideayanghui Jul 4, 2023
64b512d
Add set/get current phase api
mideayanghui Jul 4, 2023
739f9fe
Add set/get countdownTime api
mideayanghui Jul 5, 2023
c3f4b7d
delegate could be null, and that should be handled without crashing, …
mideayanghui Jul 5, 2023
74488c1
command callbacks need to respond with an error
mideayanghui Jul 5, 2023
8f03480
remove something that is not in the spec
mideayanghui Jul 5, 2023
f61ac7a
optimize the name of class member function
mideayanghui Jul 5, 2023
7da110c
Optimize struct GenericOperationCompletion
mideayanghui Jul 5, 2023
d694cf0
update struct GenericOperationCompletion test case
mideayanghui Jul 5, 2023
1fc34b7
Optimize struct GenericOperationCompletion api
mideayanghui Jul 5, 2023
538b65c
add coutdownTime attribute in operational state cluter
mideayanghui Jul 5, 2023
d1bd459
change api of initializing OperationalStateServer instances
mideayanghui Jul 5, 2023
c668b83
merge master branch into feature/operational-state-cluster-sdk-impl-1…
mideayanghui Jul 5, 2023
cde9fc6
remove the code using operational state in other platform
mideayanghui Jul 5, 2023
9c4a5b2
Add operational state server init in linux all-cluster-app
mideayanghui Jul 5, 2023
31bef4d
Restyled by whitespace
restyled-commits Jul 5, 2023
b473b56
Restyled by clang-format
restyled-commits Jul 5, 2023
50257b2
Restyled by prettier-json
restyled-commits Jul 5, 2023
b89533f
Add TestOperationalState.yaml
mideayanghui Jul 5, 2023
db4a000
rm TestOperationalStateDelegateImpl.cpp
mideayanghui Jul 5, 2023
2e01327
Merge branch 'master' into feature/operational-state-cluster-sdk-impl-1
mideayanghui Jul 5, 2023
0fce491
Restyled by whitespace
restyled-commits Jul 5, 2023
264bd1f
Restyled by gn
restyled-commits Jul 5, 2023
ebd1638
Restyled by prettier-yaml
restyled-commits Jul 5, 2023
9761cc9
remove the api, filing a followup issue to emit the right events
mideayanghui Jul 7, 2023
0f0825c
merge master branch into feature/operational-state-cluster-sdk-impl-1…
mideayanghui Jul 7, 2023
550c042
fix CI build error
mideayanghui Jul 7, 2023
e27a883
fix CI build err
mideayanghui Jul 7, 2023
1ab5c6c
Restyled by clang-format
restyled-commits Jul 7, 2023
42071a7
fix build error
mideayanghui Jul 7, 2023
a258c70
Restyled by clang-format
restyled-commits Jul 7, 2023
3375894
update document
mideayanghui Jul 11, 2023
9c5c623
use NullOptional to instead Missing
mideayanghui Jul 11, 2023
6a502c1
return CHIP_ERROR_INCORRECT_STATE when delegate is nullptr
mideayanghui Jul 11, 2023
459ddcd
optimize reading the operational state list
mideayanghui Jul 11, 2023
3641de2
move the position of testcase
mideayanghui Jul 11, 2023
d5a4f27
Merge branch 'master' into feature/operational-state-cluster-sdk-impl-1
mideayanghui Jul 11, 2023
eed50ad
fix ci build err
mideayanghui Jul 11, 2023
c130e4e
fix ci build err
mideayanghui Jul 11, 2023
1f9edc3
Restyled by clang-format
restyled-commits Jul 11, 2023
685309a
fix readability-else-after-return error
mideayanghui Jul 12, 2023
0f05b6d
Merge branch 'master' into feature/operational-state-cluster-sdk-impl-1
mideayanghui Jul 12, 2023
80c7ea2
fix Unknown key in CI build
mideayanghui Jul 12, 2023
08cea64
Merge branch 'master' into feature/operational-state-cluster-sdk-impl-1
mideayanghui Jul 13, 2023
29b240c
add note in ciTest.json for darwin-framework-tool
mideayanghui Jul 13, 2023
02c07c4
update document for api
mideayanghui Jul 13, 2023
48951c9
use Zcl instead NotSpecified in log
mideayanghui Jul 13, 2023
33d36f8
fix TestOperationalState error
mideayanghui Jul 13, 2023
de8923b
zap_regen_all
mideayanghui Jul 13, 2023
34c0c0f
optimize lambda function use
mideayanghui Jul 13, 2023
6ab1c5d
Restyled by clang-format
restyled-commits Jul 13, 2023
9582687
fix ci error: readability-else-after-return
mideayanghui Jul 13, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -2542,6 +2542,66 @@ server cluster AirQuality = 91 {
readonly attribute int16u clusterRevision = 65533;
}

/** This cluster supports remotely monitoring and, where supported, changing the operational state of any device where a state machine is a part of the operation. */
server cluster OperationalState = 96 {
enum ErrorStateEnum : ENUM8 {
kNoError = 0;
kUnableToStartOrResume = 1;
kUnableToCompleteOperation = 2;
kCommandInvalidInState = 3;
}

enum OperationalStateEnum : ENUM8 {
kStopped = 0;
kRunning = 1;
kPaused = 2;
kError = 3;
}

struct ErrorStateStruct {
enum8 errorStateID = 0;
optional char_string<64> errorStateLabel = 1;
optional char_string<64> errorStateDetails = 2;
}

struct OperationalStateStruct {
enum8 operationalStateID = 0;
optional char_string<64> operationalStateLabel = 1;
}

critical event OperationalError = 0 {
ErrorStateStruct errorState = 0;
}

info event OperationCompletion = 1 {
ENUM8 completionErrorCode = 0;
optional nullable elapsed_s totalOperationalTime = 1;
optional nullable elapsed_s pausedTime = 2;
}

readonly attribute nullable CHAR_STRING phaseList[] = 0;
readonly attribute nullable int8u currentPhase = 1;
readonly attribute nullable elapsed_s countdownTime = 2;
readonly attribute OperationalStateStruct operationalStateList[] = 3;
readonly attribute OperationalStateStruct operationalState = 4;
readonly attribute ErrorStateStruct operationalError = 5;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

response struct OperationalCommandResponse = 4 {
ErrorStateStruct commandResponseState = 0;
}

command Pause(): OperationalCommandResponse = 0;
command Stop(): OperationalCommandResponse = 1;
command Start(): OperationalCommandResponse = 2;
command Resume(): OperationalCommandResponse = 3;
}

/** Attributes and commands for monitoring HEPA filters in a device */
server cluster HepaFilterMonitoring = 113 {
enum ChangeIndicationEnum : ENUM8 {
Expand Down Expand Up @@ -6341,6 +6401,23 @@ endpoint 1 {
ram attribute clusterRevision default = 1;
}

server cluster OperationalState {
emits event OperationalError;
emits event OperationCompletion;
callback attribute phaseList;
callback attribute currentPhase;
callback attribute countdownTime;
callback attribute operationalStateList;
callback attribute operationalState;
callback attribute operationalError;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;
}

server cluster HepaFilterMonitoring {
ram attribute condition;
ram attribute degradationDirection;
Expand Down
Loading