-
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
[BUG] dynamic-bridge - handling of 0 as default attribute value is different for static and dynamic clusters #25946
Comments
This seems like a bug in the IDL bits, @andy31415 |
Looks like some inconsistency for sure. @bndkk could you provide me with a concrete example/reproduction? What zap file should I use or how should I change things to see this behavior? Can you give me a concrete |
I see What would be your expectation for the IDL to contain? |
Currently I see in
|
In zap I see (for server side):
so it does seem like it should want a defaultValue of 0. |
The issue may be with the logic of |
For a nullable attribute where the default is actually set to null, the
It also returns false for the string Which means it's broken for nullable attributes of various types. Why are we testing for this "non_zero" condition at all? If the default value is 0, then the default value is 0 and should be represented accordingly in the .matter file, no? |
Not sure about the logic directly, from what I remember it may be that zap was setting I will try to see how things behave when I remove that logic. |
Reproduction steps
As the title says: If the default value of a nullable numeric cluster attribute is set to 0 in a .zap file it doesn't behave the same for static and dynamic(generated from matter idl) clusters.
Because of this line, if a an attribute default in a .zap file is set to 0 the default doesn't get set in the .matter file and a nullable value gets initialized to NULL, when using dynamic generation.
On the other hand if the same cluster attribute is used statically(from GENERATED_CLUSTERS array), 0 is a legitimate value and isn't considered as NULL.
This has caused me some issues, because Apple Home would always say "Device not responding", when I used it with the dynamically generated WindowCovering cluster, which has the CurrentPositionLiftPercent100ths attribute, which is left empty(0) (NULL when generating dynamically) by default. When using it with fixed clusters(all-clusters-app) it would work fine because the attribute would return 0.
Bug prevalence
Whenever I do this
GitHub hash of the SDK that was being used
7ccd5d4
Platform
core
Platform Version(s)
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: