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

Bugfix: Dont read non-existing attributes for lock/unlock commands #19373

Conversation

Morozov-5F
Copy link
Contributor

Problem

Change overview

  • Don't rely on the RequirePINforRemoteOperation attribute when it's not present.
  • Update YAML tests to check lock-door and unlock-door commands when PIN is not present.

Testing

  • Manual testing: try to lock/unlock with and without PIN code, read Lock State attribute
  • Ran automated tests: DL_LockUnlock, DL_Schedules, DL_UsersAndCredentials.

@github-actions
Copy link

github-actions bot commented Jun 9, 2022

PR #19373: Size comparison from 47a51ce to 668c9c8

Increases (21 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 47a51ce 668c9c83 change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 689951 690031 80 0.0
.rodata 112327 112391 64 0.1
.text 577312 577328 16 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 640567 640671 104 0.0
.rodata 89367 89439 72 0.1
.text 550880 550912 32 0.0
lock-ftd LP_CC2652R7 (read only) 683455 683559 104 0.0
.rodata 98183 98255 72 0.1
.text 584788 584820 32 0.0
lock-mtd LP_CC2652R7 (read only) 632871 632975 104 0.0
.rodata 98071 98143 72 0.1
.text 534308 534340 32 0.0
pump-app LP_CC2652R7 (read/write) 178844 178852 8 0.0
pump-controller-app LP_CC2652R7 (read/write) 188364 188372 8 0.0
shell LP_CC2652R7 (read only) 682230 682326 96 0.0
.rodata 108926 108990 64 0.1
.text 572992 573024 32 0.0
cyw30739 lock cyw930739m2evb_01 (read/write) 599646 599670 24 0.0
.app_xip_area 458456 458480 24 0.0
efr32 lock-app BRD4161A+wf200 (read only) 958468 958572 104 0.0
.text 958460 958564 104 0.0
esp32 all-clusters-app c3devkit (read only) 1007720 1007742 22 0.0
(read/write) 1481834 1481906 72 0.0
.flash.rodata 212584 212656 72 0.0
.flash.text 1007720 1007742 22 0.0
m5stack (read only) 1062495 1062571 76 0.0
(read/write) 483968 484040 72 0.0
.flash.rodata 243084 243156 72 0.0
.flash.text 1057111 1057187 76 0.0
k32w lock k32w061+release (read/write) 714876 714964 88 0.0
.text 636616 636704 88 0.0
linux chip-tool-no-interactive-ipv6only arm64 (read only) 9499468 9501004 1536 0.0
.rodata 467916 468028 112 0.0
.text 7483220 7484644 1424 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read/write) 2429656 2429752 96 0.0
.text 1392300 1392396 96 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1192051 1192135 84 0.0
rodata 154644 154712 68 0.0
text 817112 817136 24 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1139759 1139847 88 0.0
rodata 131136 131208 72 0.1
text 789160 789184 24 0.0
p6 all-clusters-app default (read/write) 2544520 2544576 56 0.0
.text 1502784 1502840 56 0.0
all-clusters-minimal-app default (read/write) 2489392 2489448 56 0.0
.text 1447656 1447712 56 0.0
lock-app default (read/write) 2441648 2441704 56 0.0
.text 1399912 1399968 56 0.0
telink light-switch-app tlsr9518adk80d text 552570 552574 4 0.0
lighting-app tlsr9518adk80d text 569292 569294 2 0.0
Decreases (5 builds for cc13x2_26x2)
platform target config section 47a51ce 668c9c83 change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read/write) 161816 161736 -80 -0.0
lock-ftd LP_CC2652R7 (read/write) 159376 159272 -104 -0.1
pump-app LP_CC2652R7 (read only) 664899 664891 -8 -0.0
.text 578052 578044 -8 -0.0
pump-controller-app LP_CC2652R7 (read only) 655483 655475 -8 -0.0
.text 570748 570740 -8 -0.0
shell LP_CC2652R7 (read/write) 165032 164936 -96 -0.1
Full report (30 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 47a51ce 668c9c83 change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 689951 690031 80 0.0
(read/write) 161816 161736 -80 -0.0
.bss 74660 74660 0 0.0
.data 3392 3392 0 0.0
.rodata 112327 112391 64 0.1
.text 577312 577328 16 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 640567 640671 104 0.0
(read/write) 158132 158132 0 0.0
.bss 73884 73884 0 0.0
.data 3332 3332 0 0.0
.rodata 89367 89439 72 0.1
.text 550880 550912 32 0.0
lock-ftd LP_CC2652R7 (read only) 683455 683559 104 0.0
(read/write) 159376 159272 -104 -0.1
.bss 72612 72612 0 0.0
.data 3256 3256 0 0.0
.rodata 98183 98255 72 0.1
.text 584788 584820 32 0.0
lock-mtd LP_CC2652R7 (read only) 632871 632975 104 0.0
(read/write) 145720 145720 0 0.0
.bss 68348 68348 0 0.0
.data 3256 3256 0 0.0
.rodata 98071 98143 72 0.1
.text 534308 534340 32 0.0
pump-app LP_CC2652R7 (read only) 664899 664891 -8 -0.0
(read/write) 178844 178852 8 0.0
.bss 72756 72756 0 0.0
.data 3292 3292 0 0.0
.rodata 86363 86363 0 0.0
.text 578052 578044 -8 -0.0
pump-controller-app LP_CC2652R7 (read only) 655483 655475 -8 -0.0
(read/write) 188364 188372 8 0.0
.bss 72860 72860 0 0.0
.data 3252 3252 0 0.0
.rodata 84251 84251 0 0.0
.text 570748 570740 -8 -0.0
shell LP_CC2652R7 (read only) 682230 682326 96 0.0
(read/write) 165032 164936 -96 -0.1
.bss 76956 76956 0 0.0
.data 3396 3396 0 0.0
.rodata 108926 108990 64 0.1
.text 572992 573024 32 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 602562 602562 0 0.0
.app_xip_area 461508 461508 0 0.0
.bss 84008 84008 0 0.0
.data 732 732 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 599646 599670 24 0.0
.app_xip_area 458456 458480 24 0.0
.bss 84176 84176 0 0.0
.data 700 700 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 599438 599438 0 0.0
.app_xip_area 459364 459364 0 0.0
.bss 83140 83140 0 0.0
.data 616 616 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 915032 915032 0 0.0
(read/write) 133176 133176 0 0.0
.bss 131088 131088 0 0.0
.data 2088 2088 0 0.0
.text 915024 915024 0 0.0
BRD4161A+rpc (read only) 949236 949236 0 0.0
(read/write) 149868 149868 0 0.0
.bss 147576 147576 0 0.0
.data 2292 2292 0 0.0
.text 949228 949228 0 0.0
BRD4161A+rs911x (read only) 790228 790228 0 0.0
(read/write) 129460 129460 0 0.0
.bss 127364 127364 0 0.0
.data 2096 2096 0 0.0
.text 790220 790220 0 0.0
lock-app BRD4161A+wf200 (read only) 958468 958572 104 0.0
(read/write) 128252 128252 0 0.0
.bss 126188 126188 0 0.0
.data 2064 2064 0 0.0
.text 958460 958564 104 0.0
window-app BRD4161A (read only) 900088 900088 0 0.0
(read/write) 133264 133264 0 0.0
.bss 131176 131176 0 0.0
.data 2084 2084 0 0.0
.text 900080 900080 0 0.0
esp32 all-clusters-app c3devkit (read only) 1007720 1007742 22 0.0
(read/write) 1481834 1481906 72 0.0
.dram0.bss 69168 69168 0 0.0
.dram0.data 14656 14656 0 0.0
.flash.rodata 212584 212656 72 0.0
.flash.text 1007720 1007742 22 0.0
.iram0.text 62902 62902 0 0.0
m5stack (read only) 1062495 1062571 76 0.0
(read/write) 483968 484040 72 0.0
.dram0.bss 74688 74688 0 0.0
.dram0.data 34200 34200 0 0.0
.flash.rodata 243084 243156 72 0.0
.flash.text 1057111 1057187 76 0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w061+release (read/write) 653768 653768 0 0.0
.bss 70044 70044 0 0.0
.data 2004 2004 0 0.0
.text 575920 575920 0 0.0
lock k32w061+release (read/write) 714876 714964 88 0.0
.bss 70484 70484 0 0.0
.data 1976 1976 0 0.0
.text 636616 636704 88 0.0
linux chip-tool-no-interactive-ipv6only arm64 (read only) 9499468 9501004 1536 0.0
(read/write) 678033 678033 0 0.0
.bss 43681 43681 0 0.0
.data 1152 1152 0 0.0
.data.rel.ro 614464 614464 0 0.0
.dynamic 528 528 0 0.0
.got 14936 14936 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 467916 468028 112 0.0
.text 7483220 7484644 1424 0.0
thermostat-no-ble arm64 (read only) 2544060 2544060 0 0.0
(read/write) 183057 183057 0 0.0
.bss 91409 91409 0 0.0
.data 1512 1512 0 0.0
.data.rel.ro 82120 82120 0 0.0
.dynamic 528 528 0 0.0
.got 4992 4992 0 0.0
.init 24 24 0 0.0
.init_array 400 400 0 0.0
.rodata 160164 160164 0 0.0
.text 2147040 2147040 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2429656 2429752 96 0.0
.bss 202692 202692 0 0.0
.data 5872 5872 0 0.0
.text 1392300 1392396 96 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1192051 1192135 84 0.0
bss 141362 141362 0 0.0
rodata 154644 154712 68 0.0
text 817112 817136 24 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1139759 1139847 88 0.0
bss 140579 140579 0 0.0
rodata 131136 131208 72 0.1
text 789160 789184 24 0.0
p6 all-clusters-app default (read/write) 2544520 2544576 56 0.0
.bss 137120 137120 0 0.0
.data 2808 2808 0 0.0
.text 1502784 1502840 56 0.0
all-clusters-minimal-app default (read/write) 2489392 2489448 56 0.0
.bss 136328 136328 0 0.0
.data 2752 2752 0 0.0
.text 1447656 1447712 56 0.0
light-app default (read/write) 2421312 2421312 0 0.0
.bss 129432 129432 0 0.0
.data 2600 2600 0 0.0
.text 1379576 1379576 0 0.0
lock-app default (read/write) 2441648 2441704 56 0.0
.bss 129256 129256 0 0.0
.data 2576 2576 0 0.0
.text 1399912 1399968 56 0.0
telink light-switch-app tlsr9518adk80d (read/write) 781696 781696 0 0.0
bss 70636 70636 0 0.0
noinit 40416 40416 0 0.0
text 552570 552574 4 0.0
lighting-app tlsr9518adk80d (read/write) 801708 801708 0 0.0
bss 70888 70888 0 0.0
noinit 40416 40416 0 0.0
text 569292 569294 2 0.0

@Morozov-5F Morozov-5F changed the title Bugfix/dont read non existing attributes for lock unlock commands Bugfix: Dont read non-existing attributes for lock /unlock commands Jun 9, 2022
@Morozov-5F Morozov-5F changed the title Bugfix: Dont read non-existing attributes for lock /unlock commands Bugfix: Dont read non-existing attributes for lock/unlock commands Jun 9, 2022
@andy31415 andy31415 merged commit 0adc4f3 into project-chip:master Jun 9, 2022
mkardous-silabs pushed a commit to mkardous-silabs/connectedhomeip that referenced this pull request Jun 10, 2022
…roject-chip#19373)

* [project-chip#19316] Don't require PIN for locking/unlocking the door when not required

* Update auto-generated files
{
auto status = Attributes::RequirePINforRemoteOperation::Get(endpoint, &requirePin);
VerifyOrExit(
EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE == status || EMBER_ZCL_STATUS_SUCCESS == status,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if COTA and PIN are both enabled, shouldn't we fail out if the then-required attribute does not exist?

Also, the attribute is allowed to be present even if those features are disabled, I believe. @CamWms can you confirm?

@Morozov-5F

response:
value: 2

- label: "Try to unlock the door without a PIN"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This label is wrong...

rochaferraz pushed a commit to rochaferraz/connectedhomeip that referenced this pull request Jun 15, 2022
…roject-chip#19373)

* [project-chip#19316] Don't require PIN for locking/unlocking the door when not required

* Update auto-generated files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Door Lock App] Failure of basic lock/unlock
4 participants