-
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
Bugfix termostat user interface value validation #11058
Conversation
PR #11058: Size comparison from 9a618bb to 30fc7fe Increases above 0.2%:
Increases (1 build for linux)
Decreases (1 build for esp32)
Full report (36 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
|
Protocols::InteractionModel::Status status = Protocols::InteractionModel::Status::Success; | ||
if (attributePath.mClusterId == app::Clusters::Thermostat::Id) | ||
{ | ||
status = MatterThermostatClusterServerPreAttributeChangedCallback(attributePath, type, size, value); |
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.
So this is relying on all apps that use the thermostat cluster to make those calls?
It seems to me like we should be internally calling cluster-specific pre-change callbacks to handle things like this instead of forcing everyone using the SDK to know about needing to call these things. The app callback should be for app-level validation that can't be handled internally.
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.
Yes, I would also prefer that. I mean the XML definition should have the limits. So why would one need to type that stuff out.
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.
It'd still need to be typed out for now, but only once (in the shared cluster impl)...
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.
As far as I know the cluster specific callbacks were not yet in place.
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.
I see the cluster-specific pre-change callbacks present in the tv-casting app:
const EmberAfGenericClusterFunction chipFuncArrayIasZoneServer[] = { \
(EmberAfGenericClusterFunction) emberAfIasZoneClusterServerInitCallback, \
(EmberAfGenericClusterFunction) emberAfIasZoneClusterServerMessageSentCallback, \
(EmberAfGenericClusterFunction) MatterIasZoneClusterServerPreAttributeChangedCallback, \
}; \
Not sure if it is working though. But if it isn't, we should endeavor to fix it.
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.
It should work, assuming the cluster has been added to: https://github.com/project-chip/connectedhomeip/blob/master/src/app/zap-templates/templates/app/helper.js#L109
This is something I'm trying to get rid off though but it will takes time, so it sounds fair to reuse the linked mechanism.
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.
@bzbarsky-apple removed the hook up through the MatterPreAttributeChangeCallback
.
...ostat-user-interface-configuration-server/thermostat-user-interface-configuration-server.cpp
Outdated
Show resolved
Hide resolved
...ostat-user-interface-configuration-server/thermostat-user-interface-configuration-server.cpp
Outdated
Show resolved
Hide resolved
PR #11058: Size comparison from 4947759 to d3aeaa2 Increases above 0.2%:
Increases (1 build for linux)
Full report (38 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
|
/rebase |
…on in all-clsuter-app
PR #11058: Size comparison from 3f82de1 to 909c591 Increases (2 builds for linux, p6)
Full report (21 builds for efr32, k32w, linux, p6, qpg, telink)
|
PR #11058: Size comparison from 3f82de1 to d47da28 Increases (5 builds for esp32, linux, mbed, p6)
Full report (38 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
|
* add support for boundry checks for thermostat-user-interface-configuration * add impl for boundry checks for thermostat-user-interface-configuration in all-clsuter-app * add check for size and remove static cast to unit8 * add support for ProAttribute hook for thermostat user interface configuration * remove preattribute hooks in all-cluster-app/linux * regen all * fix esp32 and mbed builds
These got added along with code in initial drafts of project-chip#11058 but then the code was removed without removing the now-unnecessary headers.
#11587 to address my review comment. |
These got added along with code in initial drafts of #11058 but then the code was removed without removing the now-unnecessary headers.
* add support for boundry checks for thermostat-user-interface-configuration * add impl for boundry checks for thermostat-user-interface-configuration in all-clsuter-app * add check for size and remove static cast to unit8 * add support for ProAttribute hook for thermostat user interface configuration * remove preattribute hooks in all-cluster-app/linux * regen all * fix esp32 and mbed builds
…11587) These got added along with code in initial drafts of project-chip#11058 but then the code was removed without removing the now-unnecessary headers.
Problem
Change overview
Testing
all-cluster-app and chip-device-ctrl.