-
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
Delegate implementation for Valve Configuration and control cluster. Tested with watervalve CHEF device. #37088
base: master
Are you sure you want to change the base?
Delegate implementation for Valve Configuration and control cluster. Tested with watervalve CHEF device. #37088
Conversation
… handleOpenValve, kLevel (0x2) has to be set in feature bitmap for Open command to set the right currentLevel.
...app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.h
Outdated
Show resolved
Hide resolved
...sters/valve-configuration-and-control/chef-valve-configuration-and-control-delegate-impl.cpp
Show resolved
Hide resolved
} | ||
if (duration.IsNull()) | ||
{ | ||
std::memset(buffer, '\0', maxReadLength); |
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 this correct? The null value for a uint32_t is via https://github.com/project-chip/connectedhomeip/blob/master/src/app/util/odd-sized-integers.h#L149 and generally 0xFFFFFFFF I believe.
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.
Please run a test to validate.
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.
Internally, the attribute is store as an optional, which allows NULL values. However, the API only accepts raw bytes. So inspired from here, it seems 0xFF... interpreted as NULL is a known convention that the caller and callee can agree upon. So I've implemented it that way:
- If callee receives a write request of 0xFFF.., it simply sets the attr to NULL.
- If call receives a read request when the current attr. value is NULL, it simply returns 0xFFF..
...sters/valve-configuration-and-control/chef-valve-configuration-and-control-delegate-impl.cpp
Outdated
Show resolved
Hide resolved
...sters/valve-configuration-and-control/chef-valve-configuration-and-control-delegate-impl.cpp
Outdated
Show resolved
Hide resolved
...p/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp
Outdated
Show resolved
Hide resolved
...p/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp
Outdated
Show resolved
Hide resolved
...app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.h
Outdated
Show resolved
Hide resolved
...p/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp
Outdated
Show resolved
Hide resolved
...p/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp
Outdated
Show resolved
Hide resolved
…urationNull * When reading remaining time, max numeric value for the given size (0xFFF...) is interpreted as NULL.
PR #37088: Size comparison from f9c7a8d to 4aa5e8a Full report (7 builds for cc13x4_26x4, cc32xx, stm32)
|
PR #37088: Size comparison from 292665e to 65b22c1 Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
Adds a delegate implementation for valve configuration and control cluster intended to be used by chef devices using this cluster. Summary of changes -
RemainingTime
attribute which has only external storage option available.currentState
should be set tokClosed
in server or delegate.kLevel
feature for device.Testing with watervalve