-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Update operational state server and related examples #28577
Update operational state server and related examples #28577
Conversation
…ational state delegate change in location.
…onalStateClusterObjects.cpp
…ed cluters. Updated the examples to work with this change.
PR #28577: Size comparison from 4111aac to 18d65c1 Increases above 0.2%:
Increases (48 builds for bl602, bl702, bl702l, cc32xx, cyw30739, esp32, k32w, linux, mbed, nrfconnect, psoc6, telink)
Decreases (7 builds for efr32, k32w, linux, psoc6, telink)
Full report (60 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
src/app/clusters/operational-state-server/operational-state-server.h
Outdated
Show resolved
Hide resolved
src/app/clusters/operational-state-server/operational-state-server.h
Outdated
Show resolved
Hide resolved
src/app/clusters/operational-state-server/operational-state-server.h
Outdated
Show resolved
Hide resolved
src/app/clusters/operational-state-server/operational-state-server.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/operational-state-server/operational-state-server.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/operational-state-server/operational-state-server.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/operational-state-server/operational-state-server.cpp
Outdated
Show resolved
Hide resolved
examples/dishwasher-app/dishwasher-common/src/operational-state-delegate-impl.cpp
Show resolved
Hide resolved
…ttribute to the delegate.
…Instance classes.
… state and the ability to set the OperationalError. These can only be set via the ErrorDetected event.
…t the value given is valid.
src/app/clusters/operational-state-server/operational-state-server.h
Outdated
Show resolved
Hide resolved
src/app/clusters/operational-state-server/operational-state-server.cpp
Outdated
Show resolved
Hide resolved
Co-authored-by: Boris Zbarsky <[email protected]>
PR #28577: Size comparison from b0b0d58 to 568acd5 Increases (15 builds for bl702l, esp32, linux, nrfconnect, psoc6, telink)
Decreases (15 builds for bl602, bl702, cc32xx, cyw30739, efr32, linux, psoc6, telink)
Full report (60 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
All of the comments have been resolved and the final outstanding comment has been looked at by other reviewers to ensure that it has been resolved since this reviewer is off for 12 days.
) * Reordered Mode Base functions. * Moved generic OpState cluster objects into one header file. * Reordered OperationalStateServer functions. * Moved OpState delegate in the server header file. * Updated the TestOperationalStateDelegate inctludes following the operational state delegate change in location. * Renamed TestOperationalStateDelegate.cpp -> src/app/tests/TestOperationalStateClusterObjects.cpp * Restyled by clang-format * Minor corrections following revision. * Refactored the OperationalState server code to match with other derived cluters. Updated the examples to work with this change. * Explicitly initialised the edpoint ID in the operational state examples to improve readability. * OpState: Made OpState getters return const. * Restyled by clang-format * Moved the responsibility of storing and managing the countdown time attribute to the delegate. * Applied minor review changes. * OpState: Made the improved the relationship between the Delegate and Instance classes. * OpState: Removed the ability to set the OperationalState to the Error state and the ability to set the OperationalError. These can only be set via the ErrorDetected event. * OpState: Fixed GetCurrentOperationalError * Restyled by clang-format * Added checks to the phase and operational state setters to ensure that the value given is valid. * Added a safe method to check if two GenericOperationalError objects are equal. * GetInstance returns a const pointer. Co-authored-by: Boris Zbarsky <[email protected]> * Restyled by clang-format --------- Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Boris Zbarsky <[email protected]>
@@ -138,6 +138,35 @@ struct GenericOperationalError : public app::Clusters::detail::Structs::ErrorSta | |||
} | |||
} | |||
|
|||
bool IsEqual(const Structs::ErrorStateStruct::Type & rhs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason this is not a const method?
else if (opState == to_underlying(OperationalStateEnum::kPaused)) | ||
|
||
// Set the OperationalError attribute | ||
if (mOperationalError.IsEqual(aError)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is backward, so this code does not work correctly. Was this tested? Why is it not being tested as part of this PR?
) * Reordered Mode Base functions. * Moved generic OpState cluster objects into one header file. * Reordered OperationalStateServer functions. * Moved OpState delegate in the server header file. * Updated the TestOperationalStateDelegate inctludes following the operational state delegate change in location. * Renamed TestOperationalStateDelegate.cpp -> src/app/tests/TestOperationalStateClusterObjects.cpp * Restyled by clang-format * Minor corrections following revision. * Refactored the OperationalState server code to match with other derived cluters. Updated the examples to work with this change. * Explicitly initialised the edpoint ID in the operational state examples to improve readability. * OpState: Made OpState getters return const. * Restyled by clang-format * Moved the responsibility of storing and managing the countdown time attribute to the delegate. * Applied minor review changes. * OpState: Made the improved the relationship between the Delegate and Instance classes. * OpState: Removed the ability to set the OperationalState to the Error state and the ability to set the OperationalError. These can only be set via the ErrorDetected event. * OpState: Fixed GetCurrentOperationalError * Restyled by clang-format * Added checks to the phase and operational state setters to ensure that the value given is valid. * Added a safe method to check if two GenericOperationalError objects are equal. * GetInstance returns a const pointer. Co-authored-by: Boris Zbarsky <[email protected]> * Restyled by clang-format --------- Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Boris Zbarsky <[email protected]>
Updates the Operational State server
Makes the server and the delegate classes have pointers to each other. This will
Move the attributes and their accessor functions from the Delegate to the Server. This will