-
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
[EFR32] Fix 2 door lock edge cases #20446
Conversation
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.
Not a fan of the name IsCredentialIndexGreaterThanZero
since it is not what it return for kProgrammingPIN.
IsCredentialIndexAllowed or something in that sense would be more adequate to the method behaviour
Only problem is there's already a different function that checks the upper bound of the credential index. |
Can the function check both lower and upper bounds? or is there a reason only one bound needs to be checked? I would merge as a first choice, but if that does not work use 'UpperBound' and 'LowerBound' suffixes or find a different name based on why we have 2 different methods. |
I ended up just removed the index > 0 check. This should be taken care in IsValidCredentialIndex, because the indices are unsigned. The index > 0 check should be encapsulated in |
PR #20446: Size comparison from 4f7d5cf to 91f9d02 Increases (5 builds for cc13x2_26x2, cyw30739, mbed, telink)
Decreases (2 builds for cc13x2_26x2, efr32)
Full report (41 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
PR #20446: Size comparison from 4f7d5cf to 4d5e760 Increases (5 builds for cc13x2_26x2, cyw30739, mbed, telink)
Decreases (4 builds for cc13x2_26x2, efr32, esp32)
Full report (41 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
* Fix 2 door lock edge cases * remove check of lower bound for credential index * remove unused function declaration Co-authored-by: Restyled.io <[email protected]>
* Fix 2 door lock edge cases * remove check of lower bound for credential index * remove unused function declaration Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Michael Rupp <[email protected]> Co-authored-by: Restyled.io <[email protected]>
Problem
When an invalid pinCode is sent with a lock command, and DUT is already locked, a SUCCESS is returned. Expected outcome is that failure is returned because the pinCode is invalid.
When clear fabric from credentials is called with the ProgrammingPin credential, an error is returned. Expected outcome is that success is returned.
Change overview
Remove any checking of lockState in the setLockState function, because the SUCCESS/FAILURE of the function does not depend on the lockState. Also removed a
return true
statement in the case where the current state is the same as the new state command received.Removed the check for the lower bound of the credentialIndex. This is encapsulated in IsValidCredentialIndex, because credentialIndex is unsigned. All door-lock indices are one-indexed, except for ProgrammingPin.. I wonder if this is overlooked in the spec.
Testing
Ran through DRLK TC 2.2 on EFR32, thread network.