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 AutoCommissioner::SetCommissioningParameters #36896

Merged

Conversation

ksperling-apple
Copy link
Contributor

@ksperling-apple ksperling-apple commented Dec 18, 2024

Unconditionally clear members that point to buffers, and handle them via the
explicit code that copies the pointed-to data. The logic to work out whether
any pointers need to be cleared was quite complicated.

Use memmove() instead of memcpy() since src and dst may overlap / be identical.

Always assign mNeedIcdRegistration when the kReadCommissioningInfo step
finishes, instead of relying on SetCommissioningParameters to clear it.

Copy link

Review changes with  SemanticDiff

Copy link

github-actions bot commented Dec 18, 2024

PR #36896: Size comparison from 238e801 to 0f970a1

Full report (44 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, nrfconnect, nxp, psoc6, qpg, stm32)
platform target config section 238e801 0f970a1 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1354296 1354296 0 0.0
RAM 104144 104144 0 0.0
bl702 lighting-app bl702+eth FLASH 652076 652076 0 0.0
RAM 25353 25353 0 0.0
bl702+wifi FLASH 829680 829680 0 0.0
RAM 14093 14093 0 0.0
bl706+mfd+rpc+littlefs FLASH 1058152 1058152 0 0.0
RAM 23933 23933 0 0.0
bl702l lighting-app bl702l+mfd+littlefs FLASH 979526 979526 0 0.0
RAM 16596 16596 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 840088 840088 0 0.0
RAM 123680 123680 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 825620 825620 0 0.0
RAM 125568 125568 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 772496 772496 0 0.0
RAM 114044 114044 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 756676 756676 0 0.0
RAM 114244 114244 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 540025 540025 0 0.0
RAM 205784 205784 0 0.0
lock CC3235SF_LAUNCHXL FLASH 574337 574337 0 0.0
RAM 205928 205928 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 681865 681865 0 0.0
RAM 78740 78740 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 701717 701717 0 0.0
RAM 81380 81380 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 701717 701717 0 0.0
RAM 81380 81380 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 658645 658645 0 0.0
RAM 73808 73808 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 618489 618489 0 0.0
RAM 71732 71732 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 638117 638117 0 0.0
RAM 74276 74276 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 638117 638117 0 0.0
RAM 74276 74276 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 637889 637889 0 0.0
RAM 74740 74740 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 657597 657597 0 0.0
RAM 77284 77284 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 657597 657597 0 0.0
RAM 77284 77284 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 614341 614341 0 0.0
RAM 68828 68828 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 634193 634193 0 0.0
RAM 71460 71460 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 634193 634193 0 0.0
RAM 71460 71460 0 0.0
efr32 lock-app BRD4187C FLASH 932708 932708 0 0.0
RAM 160212 160212 0 0.0
BRD4338a FLASH 746704 746704 0 0.0
RAM 233340 233340 0 0.0
window-app BRD4187C FLASH 1025376 1025368 -8 -0.0
RAM 128316 128316 0 0.0
esp32 all-clusters-app c3devkit DRAM 95384 95384 0 0.0
FLASH 1543722 1543722 0 0.0
IRAM 82542 82542 0 0.0
m5stack DRAM 116328 116328 0 0.0
FLASH 1550286 1550286 0 0.0
IRAM 117039 117039 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 918208 918208 0 0.0
RAM 143316 143316 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 890368 890368 0 0.0
RAM 141503 141503 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 852092 852092 0 0.0
RAM 142228 142228 0 0.0
nxp contact k32w0+release FLASH 585712 585712 0 0.0
RAM 71096 71096 0 0.0
mcxw71+release FLASH 600416 600416 0 0.0
RAM 63192 63192 0 0.0
light k32w0+release FLASH 612620 612620 0 0.0
RAM 70488 70488 0 0.0
k32w1+release FLASH 686904 686904 0 0.0
RAM 48824 48824 0 0.0
lock mcxw71+release FLASH 763312 763312 0 0.0
RAM 70860 70860 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1647268 1647268 0 0.0
RAM 212112 212112 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1554708 1554708 0 0.0
RAM 208928 208928 0 0.0
light cy8ckit_062s2_43012 FLASH 1470028 1470028 0 0.0
RAM 200896 200896 0 0.0
lock cy8ckit_062s2_43012 FLASH 1467748 1467748 0 0.0
RAM 225256 225256 0 0.0
qpg lighting-app qpg6105+debug FLASH 664400 664400 0 0.0
RAM 105440 105440 0 0.0
lock-app qpg6105+debug FLASH 622212 622212 0 0.0
RAM 99892 99892 0 0.0
stm32 light STM32WB5MM-DK FLASH 485112 485112 0 0.0
RAM 144896 144896 0 0.0

@ksperling-apple ksperling-apple force-pushed the autocommissioner-parameters branch from 0f970a1 to fe0e016 Compare December 19, 2024 02:47
Unconditionally clear members that point to buffers, and handle them via the
explicit code that copies the pointed-to data. The logic to work out whether
any pointers need to be cleared was quite complicated.

Use memmove() instead of memcpy() since src and dst may overlap / be identical.

Always assign mNeedIcdRegistration when the kReadCommissioningInfo step
finishes, instead of relying on SetCommissioningParameters to clear it.
Copy link

github-actions bot commented Dec 19, 2024

PR #36896: Size comparison from 238e801 to 6d202c2

Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 238e801 6d202c2 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1354296 1354296 0 0.0
RAM 104144 104144 0 0.0
bl702 lighting-app bl702+eth FLASH 652076 652076 0 0.0
RAM 25353 25353 0 0.0
bl702+wifi FLASH 829680 829680 0 0.0
RAM 14093 14093 0 0.0
bl706+mfd+rpc+littlefs FLASH 1058152 1058152 0 0.0
RAM 23933 23933 0 0.0
bl702l lighting-app bl702l+mfd+littlefs FLASH 979526 979526 0 0.0
RAM 16596 16596 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 840088 840088 0 0.0
RAM 123680 123680 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 825620 825620 0 0.0
RAM 125568 125568 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 772496 772496 0 0.0
RAM 114044 114044 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 756676 756676 0 0.0
RAM 114244 114244 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 540025 540025 0 0.0
RAM 205784 205784 0 0.0
lock CC3235SF_LAUNCHXL FLASH 574337 574337 0 0.0
RAM 205928 205928 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 681865 681865 0 0.0
RAM 78740 78740 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 701717 701717 0 0.0
RAM 81380 81380 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 701717 701717 0 0.0
RAM 81380 81380 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 658645 658645 0 0.0
RAM 73808 73808 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 618489 618489 0 0.0
RAM 71732 71732 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 638117 638117 0 0.0
RAM 74276 74276 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 638117 638117 0 0.0
RAM 74276 74276 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 637889 637889 0 0.0
RAM 74740 74740 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 657597 657597 0 0.0
RAM 77284 77284 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 657597 657597 0 0.0
RAM 77284 77284 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 614341 614341 0 0.0
RAM 68828 68828 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 634193 634193 0 0.0
RAM 71460 71460 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 634193 634193 0 0.0
RAM 71460 71460 0 0.0
efr32 lock-app BRD4187C FLASH 932708 932708 0 0.0
RAM 160212 160212 0 0.0
BRD4338a FLASH 746704 746704 0 0.0
RAM 233340 233340 0 0.0
window-app BRD4187C FLASH 1025376 1025368 -8 -0.0
RAM 128316 128316 0 0.0
esp32 all-clusters-app c3devkit DRAM 95384 95384 0 0.0
FLASH 1543722 1543722 0 0.0
IRAM 82542 82542 0 0.0
m5stack DRAM 116328 116328 0 0.0
FLASH 1550286 1550286 0 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4720 4720 0 0.0
FLASH 2716739 2716739 0 0.0
RAM 130024 130024 0 0.0
all-clusters-app debug unknown 5560 5560 0 0.0
FLASH 6010188 6010188 0 0.0
RAM 523720 523720 0 0.0
all-clusters-minimal-app debug unknown 5456 5456 0 0.0
FLASH 5346696 5346696 0 0.0
RAM 242808 242808 0 0.0
bridge-app debug unknown 5440 5440 0 0.0
FLASH 4686232 4686232 0 0.0
RAM 218656 218656 0 0.0
chip-tool debug unknown 5992 5992 0 0.0
FLASH 12849884 12846562 -3322 -0.0
RAM 582594 582594 0 0.0
chip-tool-ipv6only arm64 unknown 21360 21360 0 0.0
FLASH 10984448 10980944 -3504 -0.0
RAM 633536 633536 0 0.0
fabric-admin debug unknown 5816 5816 0 0.0
FLASH 11256433 11253111 -3322 -0.0
RAM 582946 582946 0 0.0
fabric-bridge-app debug unknown 4696 4696 0 0.0
FLASH 4511624 4511624 0 0.0
RAM 205824 205824 0 0.0
fabric-sync debug unknown 4936 4936 0 0.0
FLASH 5611685 5608357 -3328 -0.1
RAM 472792 472792 0 0.0
lighting-app debug+rpc+ui unknown 6104 6104 0 0.0
FLASH 5622961 5622961 0 0.0
RAM 228984 228984 0 0.0
lock-app debug unknown 5376 5376 0 0.0
FLASH 4735504 4735504 0 0.0
RAM 204968 204968 0 0.0
ota-provider-app debug unknown 4752 4752 0 0.0
FLASH 4361210 4361210 0 0.0
RAM 198656 198656 0 0.0
ota-requestor-app debug unknown 4688 4688 0 0.0
FLASH 4500234 4500234 0 0.0
RAM 203240 203240 0 0.0
shell debug unknown 4248 4248 0 0.0
FLASH 3034125 3034125 0 0.0
RAM 160640 160640 0 0.0
thermostat-no-ble arm64 unknown 9560 9560 0 0.0
FLASH 4105424 4105424 0 0.0
RAM 243288 243288 0 0.0
tv-app debug unknown 5704 5704 0 0.0
FLASH 5960805 5957493 -3312 -0.1
RAM 596208 596208 0 0.0
tv-casting-app debug unknown 5288 5288 0 0.0
FLASH 11056365 11056365 0 0.0
RAM 692472 692472 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 918208 918208 0 0.0
RAM 143316 143316 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 890368 890368 0 0.0
RAM 141503 141503 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 852092 852092 0 0.0
RAM 142228 142228 0 0.0
nxp contact k32w0+release FLASH 585712 585712 0 0.0
RAM 71096 71096 0 0.0
mcxw71+release FLASH 600416 600416 0 0.0
RAM 63192 63192 0 0.0
light k32w0+release FLASH 612620 612620 0 0.0
RAM 70488 70488 0 0.0
k32w1+release FLASH 686904 686904 0 0.0
RAM 48824 48824 0 0.0
lock mcxw71+release FLASH 763312 763312 0 0.0
RAM 70860 70860 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1647268 1647268 0 0.0
RAM 212112 212112 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1554708 1554708 0 0.0
RAM 208928 208928 0 0.0
light cy8ckit_062s2_43012 FLASH 1470028 1470028 0 0.0
RAM 200896 200896 0 0.0
lock cy8ckit_062s2_43012 FLASH 1467748 1467748 0 0.0
RAM 225256 225256 0 0.0
qpg lighting-app qpg6105+debug FLASH 664400 664400 0 0.0
RAM 105440 105440 0 0.0
lock-app qpg6105+debug FLASH 622212 622212 0 0.0
RAM 99892 99892 0 0.0
stm32 light STM32WB5MM-DK FLASH 485112 485112 0 0.0
RAM 144896 144896 0 0.0
telink bridge-app tlsr9258a FLASH 683318 683318 0 0.0
RAM 91232 91232 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 623738 623738 0 0.0
RAM 31472 31472 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 772556 772556 0 0.0
RAM 49332 49332 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 711178 711178 0 0.0
RAM 73528 73528 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 628188 628188 0 0.0
RAM 142164 142164 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 814206 814206 0 0.0
RAM 99708 99708 0 0.0
tizen all-clusters-app arm unknown 5000 5000 0 0.0
FLASH 1735380 1735380 0 0.0
RAM 90840 90840 0 0.0
chip-tool-ubsan arm unknown 10808 10808 0 0.0
FLASH 17975582 17969158 -6424 -0.0
RAM 7843540 7841452 -2088 -0.0

@mergify mergify bot merged commit 9b41819 into project-chip:master Dec 19, 2024
68 checks passed
@ksperling-apple ksperling-apple deleted the autocommissioner-parameters branch December 19, 2024 18:29
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.

4 participants