Skip to content
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

Simplify enum checking in door lock code #20936

Closed
bzbarsky-apple opened this issue Jul 19, 2022 · 2 comments · Fixed by #24879
Closed

Simplify enum checking in door lock code #20936

bzbarsky-apple opened this issue Jul 19, 2022 · 2 comments · Fixed by #24879
Labels
app-clusters Application cluster work

Comments

@bzbarsky-apple
Copy link
Contributor

There are also some places in the door lock (here, here, here, here and here) where we check the range of the enum value. Maybe we can now simplify the checks and just verify the value against corresponding kUnknownEnumValue?

Originally posted by @Morozov-5F in #20907 (comment)

@Dan-Matosian
Copy link

This is not a must have for v1.0. This clean up will happen post 1.0

@stale
Copy link

stale bot commented Feb 4, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale Stale issue or PR label Feb 4, 2023
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Feb 6, 2023
Instead of explicitly checking for the min/max values, check for the "unknown
value" value that decoding will decode to if the value is out of range.

Fixes project-chip#20936
@bzbarsky-apple bzbarsky-apple removed the stale Stale issue or PR label Feb 6, 2023
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Feb 6, 2023
Instead of explicitly checking for the min/max values, check for the "unknown
value" value that decoding will decode to if the value is out of range.

Fixes project-chip#20936
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Feb 6, 2023
Instead of explicitly checking for the min/max values, check for the "unknown
value" value that decoding will decode to if the value is out of range.

Fixes project-chip#20936
bzbarsky-apple added a commit that referenced this issue Feb 8, 2023
* Simplify and future-proof enum range checks in door locks.

Instead of explicitly checking for the min/max values, check for the "unknown
value" value that decoding will decode to if the value is out of range.

Fixes #20936

* Address review commment.

* Address more review comments.
lpbeliveau-silabs pushed a commit to lpbeliveau-silabs/connectedhomeip that referenced this issue Feb 13, 2023
…hip#24879)

* Simplify and future-proof enum range checks in door locks.

Instead of explicitly checking for the min/max values, check for the "unknown
value" value that decoding will decode to if the value is out of range.

Fixes project-chip#20936

* Address review commment.

* Address more review comments.
kkasperczyk-no pushed a commit to kkasperczyk-no/sdk-connectedhomeip that referenced this issue Mar 15, 2023
* Simplify and future-proof enum range checks in door locks.

Instead of explicitly checking for the min/max values, check for the "unknown
value" value that decoding will decode to if the value is out of range.

Fixes project-chip/connectedhomeip#20936

* Address review commment.

* Address more review comments.
kkasperczyk-no pushed a commit to kkasperczyk-no/sdk-connectedhomeip that referenced this issue Mar 15, 2023
* Simplify and future-proof enum range checks in door locks.

Instead of explicitly checking for the min/max values, check for the "unknown
value" value that decoding will decode to if the value is out of range.

Fixes project-chip/connectedhomeip#20936

* Address review commment.

* Address more review comments.
lecndav pushed a commit to lecndav/connectedhomeip that referenced this issue Mar 22, 2023
…hip#24879)

* Simplify and future-proof enum range checks in door locks.

Instead of explicitly checking for the min/max values, check for the "unknown
value" value that decoding will decode to if the value is out of range.

Fixes project-chip#20936

* Address review commment.

* Address more review comments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app-clusters Application cluster work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants