-
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
OnOff Cluster does not enforce EffectVariant value requirements correctly #34214
Comments
That's not what the spec I am looking at says. It says That said, while the XML is correct, this spec requirement:
does not seem to be enforced. And that said, the spec really needs to define the behavior here more clearly: what happens if EffectIdentifier is DyingLight but EffectVariant is set to 1? |
@bzbarsky-apple |
Thanks for your reply! I have a follow-up question: If a given value, such as 4, exceeds the range of the DelayedAllOffEffectVariantEnum, what is the corresponding default value? Another observation:
This command could work incorrectly due to the missing enum8 constraints. |
@agatah2333 Good catch. What is the default variant is lost in translation from Zigbee to Matter. But variant with value 0x00 must be considered as the default. |
@agatah2333 I'm not sure whether I catch your point on the command example. Are you saying that today chip-tool allows (and sends) the variant parameter with value 10? I would say that is good for testing. :-) |
@agatah2333 @bzbarsky-apple @Rob-Houtepen-Signify We should add a check to the command handler to return a constraint error here. Lastly, off effect is implemented such that the user must register a callback to their effect implementation. The invalid parameter can be caught there too by each users implementation. |
Yes! That is exactly what I mean. Thanks for trying to understand! I viewed the XML files, and it seems most clusters have well-defined minimum or maximum values. However, when running the chip-tool, you can see many values exceed these limits, as mentioned in the previous issue I raised in
Since Matter uses a data model to detail the constraints of the range of parameter value, is there any automated way to generate these constraints when using ZAP to generate the code? |
@Rob-Houtepen-Signify @bzbarsky-apple From the cluster spec.
I understand from your comment above in this ticket :
That any unsupported/undefined value should apply a default effect variant However, from the second sentence of the spec, I understand that the received Value for the EffectVariant shall be a value listed in either enums (DelayedAllOffEffectVariantEnum / DyingLightEffectVariantEnum). Can you clarify, if an unknown value would classified as an unsupported value or not? As I see it, a server could not support, lets say, |
That is the question, yes. I think the spec was aiming for "use default for any unrecognized value", but I don't know this 100% for sure. |
@bzbarsky-apple Yes, "use default for any unrecognized value" was the intended behavior. |
Note that the defaults are the effects / variants with value 0x00. (This is lost in translation from ZCL.) |
@Rob-Houtepen-Signify @bzbarsky-apple Thanks, I will apply in the SDK PR. Would it be valuable to clarify in the spec |
Reproduction steps
The type for Field 1 of Command 0x40 in the OnOff cluster should be DelayedAllOffEffectVariantEnum, but it is currently written as enum8. The range of values is inconsistent.
The range of DelayedAllOffEffectVariantEnum is 0-2, result in
This command could work incorrectly due to the missing constraints.
Bug prevalence
each time
GitHub hash of the SDK that was being used
5bb5c9e
Platform
other
Platform Version(s)
1.3
Type
Spec Compliance Issue, Security Issue, Core SDK Performance Improvement, Core SDK Interopability Issue
Anything else?
No response
The text was updated successfully, but these errors were encountered: