Skip to content

[CodeDriven] Migrate Relative Humidity Measurement cluster to code-driven implementation#71424

Open
Elen777300 wants to merge 19 commits intoproject-chip:masterfrom
Elen777300:relative-humidity-measurement-code-driven
Open

[CodeDriven] Migrate Relative Humidity Measurement cluster to code-driven implementation#71424
Elen777300 wants to merge 19 commits intoproject-chip:masterfrom
Elen777300:relative-humidity-measurement-code-driven

Conversation

@Elen777300
Copy link
Copy Markdown
Contributor

@Elen777300 Elen777300 commented Apr 6, 2026

Summary

Converts the Relative Humidity Measurement cluster from a pure-Ember implementation to the code-driven pattern using DefaultServerCluster.

  • Add RelativeHumidityMeasurementCluster (C++ class + CodegenIntegration)
  • Add BUILD.gn, app_config_dependent_sources.gni/.cmake
  • Add unit tests (TestRelativeHumidityMeasurementCluster)
  • Register in src/app/clusters/BUILD.gn and src/BUILD.gn (tests)
  • Add to CodeDrivenClusters in config-data.yaml
  • Add attributeAccessInterfaceAttributes in zcl.json and zcl-with-test-extensions.json
  • Update zap_cluster_list.json ServerDirectories

Related issues

#71423

Testing

Readability checklist

@github-actions github-actions bot added the app label Apr 6, 2026
@pullapprove pullapprove bot added review - pending and removed app labels Apr 6, 2026
@Elen777300 Elen777300 linked an issue Apr 6, 2026 that may be closed by this pull request
@github-actions github-actions bot added the app label Apr 6, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements the Relative Humidity Measurement cluster as a code-driven server. The changes include the core cluster logic with attribute constraint validation, integration delegates for the codegen data model, and a suite of unit tests. A review comment identifies a likely compilation error in the Attributes method where kMandatoryMetadata requires a namespace prefix to be correctly resolved.

@Elen777300 Elen777300 force-pushed the relative-humidity-measurement-code-driven branch from 3298e5c to a2a644e Compare April 6, 2026 16:57
@github-actions github-actions bot added examples scripts examples chef Changes in examples/chef labels Apr 6, 2026
@Elen777300 Elen777300 force-pushed the relative-humidity-measurement-code-driven branch 2 times, most recently from ff4f9ed to c956ccd Compare April 6, 2026 17:11
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

PR #71424: Size comparison from da57c2e to c956ccd

Full report (9 builds for cc13x4_26x4, cc32xx, realtek, stm32)
platform target config section da57c2e c956ccd change % change
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 775864 775864 0 0.0
RAM 103396 103396 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 788068 788068 0 0.0
RAM 108588 108588 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 734392 734392 0 0.0
RAM 97396 97396 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 717812 717812 0 0.0
RAM 97556 97556 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 559874 561038 1164 0.2
RAM 204568 204608 40 0.0
lock CC3235SF_LAUNCHXL FLASH 592742 592742 0 0.0
RAM 204816 204816 0 0.0
realtek light-switch-app rtl8777g FLASH 676960 676960 0 0.0
RAM 101516 101516 0 0.0
lighting-app rtl8777g FLASH 724504 724504 0 0.0
RAM 101956 101956 0 0.0
stm32 light STM32WB5MM-DK FLASH 475428 475428 0 0.0
RAM 141388 141388 0 0.0

@Elen777300 Elen777300 force-pushed the relative-humidity-measurement-code-driven branch from c956ccd to cdc9eb6 Compare April 6, 2026 17:37
@Elen777300 Elen777300 requested a review from a team as a code owner April 6, 2026 17:37
@Elen777300 Elen777300 changed the title [CodeDriven] Migrate cluster to code-driven implementation [CodeDriven] Migrate Relative Humidity Measurement cluster to code-driven implementation Apr 6, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

PR #71424: Size comparison from da57c2e to dd7daa4

Full report (21 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, nrfconnect, psoc6, qpg, realtek, stm32)
platform target config section da57c2e dd7daa4 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1090510 1090510 0 0.0
RAM 144858 144858 0 0.0
bl616 lighting-app bl616+thread FLASH 1101964 1101964 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1588876 1588876 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1053644 1053644 0 0.0
RAM 108461 108461 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 892302 892302 0 0.0
RAM 105852 105852 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 775864 775864 0 0.0
RAM 103396 103396 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 788068 788068 0 0.0
RAM 108588 108588 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 734392 734392 0 0.0
RAM 97396 97396 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 717812 717812 0 0.0
RAM 97556 97556 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 559874 561038 1164 0.2
RAM 204568 204608 40 0.0
lock CC3235SF_LAUNCHXL FLASH 592742 592742 0 0.0
RAM 204816 204816 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 860540 861472 932 0.1
RAM 162094 162174 80 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1711588 1713004 1416 0.1
RAM 214028 214116 88 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1609356 1610780 1424 0.1
RAM 210908 210996 88 0.0
light cy8ckit_062s2_43012 FLASH 1466876 1466876 0 0.0
RAM 197068 197068 0 0.0
lock cy8ckit_062s2_43012 FLASH 1499596 1499596 0 0.0
RAM 224820 224820 0 0.0
qpg lighting-app qpg6200+debug FLASH 842636 842636 0 0.0
RAM 127868 127868 0 0.0
lock-app qpg6200+debug FLASH 781252 781252 0 0.0
RAM 118816 118816 0 0.0
realtek light-switch-app rtl8777g FLASH 676960 676960 0 0.0
RAM 101516 101516 0 0.0
lighting-app rtl8777g FLASH 724504 724504 0 0.0
RAM 101956 101956 0 0.0
stm32 light STM32WB5MM-DK FLASH 475428 475428 0 0.0
RAM 141388 141388 0 0.0

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

❌ Patch coverage is 75.86207% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.33%. Comparing base (cdb458b) to head (b31a09d).
⚠️ Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
...humidity-measurement-server/CodegenIntegration.cpp 45.71% 19 Missing ⚠️
...ment-server/RelativeHumidityMeasurementCluster.cpp 95.45% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #71424      +/-   ##
==========================================
+ Coverage   54.32%   54.33%   +0.01%     
==========================================
  Files        1577     1580       +3     
  Lines      108257   108344      +87     
  Branches    13401    13403       +2     
==========================================
+ Hits        58806    58872      +66     
- Misses      49451    49472      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

PR #71424: Size comparison from da57c2e to ba2e81c

Full report (34 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
platform target config section da57c2e ba2e81c change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1090510 1090510 0 0.0
RAM 144858 144858 0 0.0
bl616 lighting-app bl616+thread FLASH 1101964 1101964 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1588876 1588876 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1053644 1053644 0 0.0
RAM 108461 108461 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 892302 892302 0 0.0
RAM 105852 105852 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 775864 775864 0 0.0
RAM 103396 103396 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 788068 788068 0 0.0
RAM 108588 108588 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 734392 734392 0 0.0
RAM 97396 97396 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 717812 717812 0 0.0
RAM 97556 97556 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 559874 561254 1380 0.2
RAM 204568 204608 40 0.0
lock CC3235SF_LAUNCHXL FLASH 592742 592742 0 0.0
RAM 204816 204816 0 0.0
efr32 lock-app BRD4187C FLASH 992164 992164 0 0.0
RAM 131268 131268 0 0.0
BRD4338a FLASH 794633 794625 -8 -0.0
RAM 243044 243044 0 0.0
window-app BRD4187C FLASH 1097676 1097676 0 0.0
RAM 130308 130308 0 0.0
esp32 all-clusters-app c3devkit DRAM 98460 98540 80 0.1
FLASH 1599064 1600488 1424 0.1
IRAM 93514 93514 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 860540 861660 1120 0.1
RAM 162094 162174 80 0.0
nxp contact mcxw71+release FLASH 738992 738992 0 0.0
RAM 67016 67016 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1711588 1713196 1608 0.1
RAM 214028 214116 88 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1609356 1610964 1608 0.1
RAM 210908 210996 88 0.0
light cy8ckit_062s2_43012 FLASH 1466876 1466876 0 0.0
RAM 197068 197068 0 0.0
lock cy8ckit_062s2_43012 FLASH 1499596 1499596 0 0.0
RAM 224820 224820 0 0.0
qpg lighting-app qpg6200+debug FLASH 842636 842636 0 0.0
RAM 127868 127868 0 0.0
lock-app qpg6200+debug FLASH 781252 781252 0 0.0
RAM 118816 118816 0 0.0
realtek light-switch-app rtl8777g FLASH 676960 676960 0 0.0
RAM 101516 101516 0 0.0
lighting-app rtl8777g FLASH 724504 724504 0 0.0
RAM 101956 101956 0 0.0
stm32 light STM32WB5MM-DK FLASH 475428 475428 0 0.0
RAM 141388 141388 0 0.0
telink bridge-app tl7218x FLASH 730852 730852 0 0.0
RAM 95924 95924 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 850306 850306 0 0.0
RAM 44340 44340 0 0.0
tl7218x FLASH 841712 841712 0 0.0
RAM 99724 99724 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 729992 729992 0 0.0
RAM 55904 55904 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 793218 793218 0 0.0
RAM 75080 75080 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 729936 729936 0 0.0
RAM 33388 33388 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 613142 613142 0 0.0
RAM 118396 118396 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 839846 839850 4 0.0
RAM 97432 97432 0 0.0

@Elen777300 Elen777300 force-pushed the relative-humidity-measurement-code-driven branch from ba2e81c to f1609ea Compare April 7, 2026 07:27
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

PR #71424: Size comparison from 5f91738 to f1609ea

Full report (34 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
platform target config section 5f91738 f1609ea change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1090510 1090510 0 0.0
RAM 144858 144858 0 0.0
bl616 lighting-app bl616+thread FLASH 1101964 1101964 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1588876 1588876 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1053644 1053644 0 0.0
RAM 108461 108461 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 892302 892302 0 0.0
RAM 105852 105852 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 775864 775864 0 0.0
RAM 103396 103396 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 788068 788068 0 0.0
RAM 108588 108588 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 734392 734392 0 0.0
RAM 97396 97396 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 717812 717812 0 0.0
RAM 97556 97556 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 559874 561254 1380 0.2
RAM 204568 204608 40 0.0
lock CC3235SF_LAUNCHXL FLASH 592742 592742 0 0.0
RAM 204816 204816 0 0.0
efr32 lock-app BRD4187C FLASH 992164 992164 0 0.0
RAM 131268 131268 0 0.0
BRD4338a FLASH 794633 794625 -8 -0.0
RAM 243044 243044 0 0.0
window-app BRD4187C FLASH 1097676 1097676 0 0.0
RAM 130308 130308 0 0.0
esp32 all-clusters-app c3devkit DRAM 98460 98540 80 0.1
FLASH 1599064 1600488 1424 0.1
IRAM 93514 93514 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 862116 863236 1120 0.1
RAM 162094 162174 80 0.0
nxp contact mcxw71+release FLASH 738992 738992 0 0.0
RAM 67016 67016 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1711588 1713196 1608 0.1
RAM 214028 214116 88 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1609356 1610964 1608 0.1
RAM 210908 210996 88 0.0
light cy8ckit_062s2_43012 FLASH 1466876 1466876 0 0.0
RAM 197068 197068 0 0.0
lock cy8ckit_062s2_43012 FLASH 1499596 1499596 0 0.0
RAM 224820 224820 0 0.0
qpg lighting-app qpg6200+debug FLASH 842636 842636 0 0.0
RAM 127868 127868 0 0.0
lock-app qpg6200+debug FLASH 781252 781252 0 0.0
RAM 118816 118816 0 0.0
realtek light-switch-app rtl8777g FLASH 676960 676960 0 0.0
RAM 101516 101516 0 0.0
lighting-app rtl8777g FLASH 724504 724504 0 0.0
RAM 101956 101956 0 0.0
stm32 light STM32WB5MM-DK FLASH 475428 475428 0 0.0
RAM 141388 141388 0 0.0
telink bridge-app tl7218x FLASH 730852 730852 0 0.0
RAM 95924 95924 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 850306 850306 0 0.0
RAM 44340 44340 0 0.0
tl7218x FLASH 841712 841712 0 0.0
RAM 99724 99724 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 729992 729992 0 0.0
RAM 55904 55904 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 793218 793218 0 0.0
RAM 75080 75080 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 729936 729936 0 0.0
RAM 33388 33388 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 613142 613142 0 0.0
RAM 118396 118396 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 839846 839850 4 0.0
RAM 97432 97432 0 0.0

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

PR #71424: Size comparison from 5f91738 to 6167526

Full report (1 build for stm32)
platform target config section 5f91738 6167526 change % change
stm32 light STM32WB5MM-DK FLASH 475428 475428 0 0.0
RAM 141388 141388 0 0.0

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

PR #71424: Size comparison from 5f91738 to 4366a9b

Full report (34 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
platform target config section 5f91738 4366a9b change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1090510 1090510 0 0.0
RAM 144858 144858 0 0.0
bl616 lighting-app bl616+thread FLASH 1101964 1101964 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1588876 1588876 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1053644 1053644 0 0.0
RAM 108461 108461 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 892302 892302 0 0.0
RAM 105852 105852 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 775864 775864 0 0.0
RAM 103396 103396 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 788068 788068 0 0.0
RAM 108588 108588 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 734392 734392 0 0.0
RAM 97396 97396 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 717812 717812 0 0.0
RAM 97556 97556 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 559874 561254 1380 0.2
RAM 204568 204608 40 0.0
lock CC3235SF_LAUNCHXL FLASH 592742 592742 0 0.0
RAM 204816 204816 0 0.0
efr32 lock-app BRD4187C FLASH 992164 992164 0 0.0
RAM 131268 131268 0 0.0
BRD4338a FLASH 794633 794625 -8 -0.0
RAM 243044 243044 0 0.0
window-app BRD4187C FLASH 1097676 1097676 0 0.0
RAM 130308 130308 0 0.0
esp32 all-clusters-app c3devkit DRAM 98460 98540 80 0.1
FLASH 1599064 1600488 1424 0.1
IRAM 93514 93514 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 862116 863236 1120 0.1
RAM 162094 162174 80 0.0
nxp contact mcxw71+release FLASH 738992 738992 0 0.0
RAM 67016 67016 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1711588 1713196 1608 0.1
RAM 214028 214116 88 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1609356 1610964 1608 0.1
RAM 210908 210996 88 0.0
light cy8ckit_062s2_43012 FLASH 1466876 1466876 0 0.0
RAM 197068 197068 0 0.0
lock cy8ckit_062s2_43012 FLASH 1499596 1499596 0 0.0
RAM 224820 224820 0 0.0
qpg lighting-app qpg6200+debug FLASH 842636 842636 0 0.0
RAM 127868 127868 0 0.0
lock-app qpg6200+debug FLASH 781252 781252 0 0.0
RAM 118816 118816 0 0.0
realtek light-switch-app rtl8777g FLASH 676960 676960 0 0.0
RAM 101516 101516 0 0.0
lighting-app rtl8777g FLASH 724504 724504 0 0.0
RAM 101956 101956 0 0.0
stm32 light STM32WB5MM-DK FLASH 475428 475428 0 0.0
RAM 141388 141388 0 0.0
telink bridge-app tl7218x FLASH 730852 730852 0 0.0
RAM 95924 95924 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 850306 850306 0 0.0
RAM 44340 44340 0 0.0
tl7218x FLASH 841712 841712 0 0.0
RAM 99724 99724 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 729992 729992 0 0.0
RAM 55904 55904 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 793218 793218 0 0.0
RAM 75080 75080 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 729936 729936 0 0.0
RAM 33388 33388 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 613142 613142 0 0.0
RAM 118396 118396 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 839846 839850 4 0.0
RAM 97432 97432 0 0.0

@andy31415
Copy link
Copy Markdown
Contributor

@Elen777300 the flash cost of this seems to be 1.4K for air purifier. Could you check where the cost comes from? I wonder if we have some combination of pure ember (table driven) to code which is a cost but also if we have more validation code than before. Anything we can do to make this smaller in size?

@Elen777300 Elen777300 force-pushed the relative-humidity-measurement-code-driven branch from f497eeb to 4ab2609 Compare April 10, 2026 09:17
@github-actions
Copy link
Copy Markdown

PR #71424: Size comparison from cdb458b to 67e490f

Full report (5 builds for cc32xx, realtek, stm32)
platform target config section cdb458b 67e490f change % change
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 559874 560798 924 0.2
RAM 204568 204608 40 0.0
lock CC3235SF_LAUNCHXL FLASH 592742 592742 0 0.0
RAM 204816 204816 0 0.0
realtek light-switch-app rtl8777g FLASH 680824 680824 0 0.0
RAM 101600 101600 0 0.0
lighting-app rtl8777g FLASH 724768 724768 0 0.0
RAM 101956 101956 0 0.0
stm32 light STM32WB5MM-DK FLASH 475468 475468 0 0.0
RAM 141388 141388 0 0.0

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 10, 2026

PR #71424: Size comparison from cdb458b to 69d577d

Full report (34 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
platform target config section cdb458b 69d577d change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1090510 1090510 0 0.0
RAM 144858 144858 0 0.0
bl616 lighting-app bl616+thread FLASH 1101988 1101988 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1588876 1588876 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1053666 1053666 0 0.0
RAM 108461 108461 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 892364 892364 0 0.0
RAM 105852 105852 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 775904 775904 0 0.0
RAM 103396 103396 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 788108 788108 0 0.0
RAM 108588 108588 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 734432 734432 0 0.0
RAM 97396 97396 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 717860 717860 0 0.0
RAM 97556 97556 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 559874 560798 924 0.2
RAM 204568 204608 40 0.0
lock CC3235SF_LAUNCHXL FLASH 592742 592742 0 0.0
RAM 204816 204816 0 0.0
efr32 lock-app BRD4187C FLASH 992512 992512 0 0.0
RAM 131268 131268 0 0.0
BRD4338a FLASH 796297 796297 0 0.0
RAM 243372 243372 0 0.0
window-app BRD4187C FLASH 1098000 1098000 0 0.0
RAM 130308 130308 0 0.0
esp32 all-clusters-app c3devkit DRAM 98460 98540 80 0.1
FLASH 1599174 1600418 1244 0.1
IRAM 93514 93514 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 862232 863200 968 0.1
RAM 162094 162174 80 0.0
nxp contact mcxw71+release FLASH 739032 739032 0 0.0
RAM 67016 67016 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1711700 1713108 1408 0.1
RAM 214028 214116 88 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1609460 1610876 1416 0.1
RAM 210908 210996 88 0.0
light cy8ckit_062s2_43012 FLASH 1466876 1466876 0 0.0
RAM 197068 197068 0 0.0
lock cy8ckit_062s2_43012 FLASH 1499596 1499596 0 0.0
RAM 224820 224820 0 0.0
qpg lighting-app qpg6200+debug FLASH 842684 842684 0 0.0
RAM 127868 127868 0 0.0
lock-app qpg6200+debug FLASH 781300 781300 0 0.0
RAM 118816 118816 0 0.0
realtek light-switch-app rtl8777g FLASH 680824 680824 0 0.0
RAM 101600 101600 0 0.0
lighting-app rtl8777g FLASH 724768 724768 0 0.0
RAM 101956 101956 0 0.0
stm32 light STM32WB5MM-DK FLASH 475468 475468 0 0.0
RAM 141388 141388 0 0.0
telink bridge-app tl7218x FLASH 730906 730906 0 0.0
RAM 95924 95924 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 850332 850332 0 0.0
RAM 44340 44340 0 0.0
tl7218x FLASH 841738 841738 0 0.0
RAM 99724 99724 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 730236 730236 0 0.0
RAM 55984 55984 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 793462 793462 0 0.0
RAM 75160 75160 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 730180 730180 0 0.0
RAM 33468 33468 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 613142 613142 0 0.0
RAM 118396 118396 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 839872 839876 4 0.0
RAM 97432 97432 0 0.0

RelativeHumidityMeasurementCluster::RelativeHumidityMeasurementCluster(EndpointId endpointId, const Config & config) :
DefaultServerCluster({ endpointId, RelativeHumidityMeasurement::Id }), mOptionalAttributeSet(config.mOptionalAttributeSet)
{
if (!config.minMeasuredValue.IsNull())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These bounds check are duplicated here and in the Set methods.

Maybe see if a helper method method would make this easier in the anon namespace?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The checks are actually different
The constructor validates the hardware config once at startup.
SetMeasuredValue validates each new sensor reading against that config at runtime.
They check different things so the helper won't really remove duplication

Copy link
Copy Markdown
Contributor

@soares-sergio soares-sergio Apr 10, 2026

Choose a reason for hiding this comment

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

Would something like this help?

namespace {
bool IsValueInHumidityRange(uint16_t value, 
                            const DataModel::Nullable<uint16_t>& min, 
                            const DataModel::Nullable<uint16_t>& max) 
{
    if (value > kMeasuredValueMax) return false;
    if (!min.IsNull() && value < min.Value()) return false;
    if (!max.IsNull() && value > max.Value()) return false;
    return true;
}
} // namespace

// Usage in SetMeasuredValue (Returning Error)
if (!measuredValue.IsNull()) {
    VerifyOrReturnError(IsValueInHumidityRange(measuredValue.Value(), mMinMeasuredValue, mMaxMeasuredValue), 
                        CHIP_IM_GLOBAL_STATUS(ConstraintError));
}

// Usage in Constructor (Crashing)
if (!config.minMeasuredValue.IsNull()) {
    VerifyOrDie(config.minMeasuredValue.Value() <= kMinMeasuredValueMax);
    if (!config.maxMeasuredValue.IsNull()) {
        VerifyOrDie(IsValueInHumidityRange(config.maxMeasuredValue.Value(), config.minMeasuredValue, 
                                           DataModel::MakeNullable(kMeasuredValueMax)));
    }
}

@soares-sergio soares-sergio added sdk-maintainer-approved PR marked by `matter-sdk-maintainers` as suitable for MERGE - meets guideline & sufficient reviews. and removed sdk-maintainer-approved PR marked by `matter-sdk-maintainers` as suitable for MERGE - meets guideline & sufficient reviews. labels Apr 10, 2026
namespace app {
namespace Clusters {

class RelativeHumiditySensorManager
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code size still seems high. Could you post the size diff here as comment so we can double check?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ELF Size Diff Breakdown (+1330 bytes)
Type Size Function Size1 Size2
REMOVED -61 chip::app::Clusters::AirPurifierManager::Init 543 604
REMOVED -52 chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::Set 0 52
REMOVED -52 chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Set 0 52
REMOVED -49 chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MeasuredValue::Set 0 49
CHANGED -8 attributeData 86 94
CHANGED 8 __frame_dummy_init_array_entry 272 264
ADDED 10 chip::app::Clusters::RelativeHumidityMeasurementCluster::~RelativeHumidityMeasurementCluster 10 0
ADDED 11 std::_Optional_payload_base<unsigned short>::_M_reset 11 0
CHANGED 15 MatterClusterServerShutdownCallback 220 205
CHANGED 16 MatterClusterServerInitCallback 218 202
ADDED 24 chip::app::Clusters::RelativeHumidityMeasurement::Attributes::kMandatoryMetadata 24 0
ADDED 55 chip::app::Clusters::RelativeHumidityMeasurement::Attributes::Tolerance::Get 55 0
ADDED 56 chip::app::Clusters::RelativeHumidityMeasurement::FindClusterOnEndpoint 56 0
ADDED 58 MatterRelativeHumidityMeasurementClusterShutdownCallback 58 0
ADDED 59 chip::app::Clusters::RelativeHumidityMeasurement::SetMeasuredValue 59 0
ADDED 69 chip::app::Clusters::RelativeHumidityMeasurementCluster::Attributes 69 0
ADDED 71 MatterRelativeHumidityMeasurementClusterInitCallback 71 0
ADDED 81 chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::Get 81 0
ADDED 81 chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Get 81 0
ADDED 100 chip::app::LazyRegisteredServerCluster<chip::app::Clusters::RelativeHumidityMeasurementCluster>::Destroy 100 0
ADDED 132 chip::app::Clusters::RelativeHumidityMeasurementCluster::SetMeasuredValue 132 0
ADDED 133 chip::ChipError chip::app::AttributeValueEncoder::Encode<chip::app::DataModel::Nullable<unsigned short>, true> 133 0
ADDED 136 vtable for chip::app::Clusters::RelativeHumidityMeasurementCluster 136 0
ADDED 148 chip::app::Clusters::RelativeHumidityMeasurementCluster::ReadAttribute 148 0
ADDED 289 chip::app::Clusters::RelativeHumidityMeasurementCluster::RelativeHumidityMeasurementCluster 289 0
TOTAL 1330 923885 922555

This cluster uses the code-driven approach. The Ember attribute accessors for
`MeasuredValue`, `MinMeasuredValue`, `MaxMeasuredValue`, and `Tolerance` are no
longer available.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should also include info on instantiating the cluster directly in their application, instead of relying on CodegenIntegration.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 10, 2026

PR #71424: Size comparison from cdb458b to e2e7c0b

Full report (21 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, nrfconnect, psoc6, qpg, realtek, stm32)
platform target config section cdb458b e2e7c0b change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1090510 1090510 0 0.0
RAM 144858 144858 0 0.0
bl616 lighting-app bl616+thread FLASH 1101988 1101988 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1588876 1588876 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1053666 1053666 0 0.0
RAM 108461 108461 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 892364 892364 0 0.0
RAM 105852 105852 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 775904 775904 0 0.0
RAM 103396 103396 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 788108 788108 0 0.0
RAM 108588 108588 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 734432 734432 0 0.0
RAM 97396 97396 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 717860 717860 0 0.0
RAM 97556 97556 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 559874 560798 924 0.2
RAM 204568 204608 40 0.0
lock CC3235SF_LAUNCHXL FLASH 592742 592742 0 0.0
RAM 204816 204816 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 862232 863200 968 0.1
RAM 162094 162174 80 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1711700 1713124 1424 0.1
RAM 214028 214116 88 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1609460 1610892 1432 0.1
RAM 210908 210996 88 0.0
light cy8ckit_062s2_43012 FLASH 1466876 1466876 0 0.0
RAM 197068 197068 0 0.0
lock cy8ckit_062s2_43012 FLASH 1499596 1499596 0 0.0
RAM 224820 224820 0 0.0
qpg lighting-app qpg6200+debug FLASH 842684 842684 0 0.0
RAM 127868 127868 0 0.0
lock-app qpg6200+debug FLASH 781300 781300 0 0.0
RAM 118816 118816 0 0.0
realtek light-switch-app rtl8777g FLASH 680824 680824 0 0.0
RAM 101600 101600 0 0.0
lighting-app rtl8777g FLASH 724768 724768 0 0.0
RAM 101956 101956 0 0.0
stm32 light STM32WB5MM-DK FLASH 475468 475468 0 0.0
RAM 141388 141388 0 0.0

@Elen777300 Elen777300 force-pushed the relative-humidity-measurement-code-driven branch from f47a68a to 2396c9f Compare April 10, 2026 17:49
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 10, 2026

PR #71424: Size comparison from 6cfa747 to b31a09d

Full report (34 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
platform target config section 6cfa747 b31a09d change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1090510 1090510 0 0.0
RAM 144858 144858 0 0.0
bl616 lighting-app bl616+thread FLASH 1101988 1101988 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1588876 1588876 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1053666 1053666 0 0.0
RAM 108461 108461 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 892364 892364 0 0.0
RAM 105852 105852 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 775904 775904 0 0.0
RAM 103396 103396 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 788108 788108 0 0.0
RAM 108588 108588 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 734432 734432 0 0.0
RAM 97396 97396 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 717860 717860 0 0.0
RAM 97556 97556 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 559874 560798 924 0.2
RAM 204568 204608 40 0.0
lock CC3235SF_LAUNCHXL FLASH 592742 592742 0 0.0
RAM 204816 204816 0 0.0
efr32 lock-app BRD4187C FLASH 992512 992512 0 0.0
RAM 131268 131268 0 0.0
BRD4338a FLASH 796297 796297 0 0.0
RAM 243372 243372 0 0.0
window-app BRD4187C FLASH 1098000 1098000 0 0.0
RAM 130308 130308 0 0.0
esp32 all-clusters-app c3devkit DRAM 98460 98540 80 0.1
FLASH 1599174 1600420 1246 0.1
IRAM 93514 93514 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 862232 863200 968 0.1
RAM 162094 162174 80 0.0
nxp contact mcxw71+release FLASH 739032 739032 0 0.0
RAM 67016 67016 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1711700 1713124 1424 0.1
RAM 214028 214116 88 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1609460 1610892 1432 0.1
RAM 210908 210996 88 0.0
light cy8ckit_062s2_43012 FLASH 1466876 1466876 0 0.0
RAM 197068 197068 0 0.0
lock cy8ckit_062s2_43012 FLASH 1499596 1499596 0 0.0
RAM 224820 224820 0 0.0
qpg lighting-app qpg6200+debug FLASH 842684 842684 0 0.0
RAM 127868 127868 0 0.0
lock-app qpg6200+debug FLASH 781300 781300 0 0.0
RAM 118816 118816 0 0.0
realtek light-switch-app rtl8777g FLASH 680824 680824 0 0.0
RAM 101600 101600 0 0.0
lighting-app rtl8777g FLASH 724768 724768 0 0.0
RAM 101956 101956 0 0.0
stm32 light STM32WB5MM-DK FLASH 475468 475468 0 0.0
RAM 141388 141388 0 0.0
telink bridge-app tl7218x FLASH 730906 730906 0 0.0
RAM 95924 95924 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 850332 850332 0 0.0
RAM 44340 44340 0 0.0
tl7218x FLASH 841738 841738 0 0.0
RAM 99724 99724 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 730236 730236 0 0.0
RAM 55984 55984 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 793462 793462 0 0.0
RAM 75160 75160 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 730180 730180 0 0.0
RAM 33468 33468 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 613142 613142 0 0.0
RAM 118396 118396 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 839872 839876 4 0.0
RAM 97432 97432 0 0.0

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.

Decouple Relative Humidity Measurement cluster to code driven

5 participants