Skip to content

[CameraAVSettings] Change response generation to be based on completion of physical PTZ actions #40565

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

Open
wants to merge 46 commits into
base: master
Choose a base branch
from

Conversation

marktrayer
Copy link
Collaborator

@marktrayer marktrayer commented Aug 13, 2025

Summary

Spec requires that the status response to a command that physically changes PTZ occurs once the physical move has completed. The code was doing this by having the app sit and spin on the event loop till this was completed. Which could be some time. Change the code so that the app leverages a callback provided by the server once the command has been executed physically. Also allows for more coherent support of the Busy response (i.e. sent when a command is in process). Additionally a new attribute (MovementState) has been added in the spec, include the Alchemy regenerated XML and new Zap regen. Update the cluster to support this attribute and it's logic with respect to PTZ commands (physical).

Update test scripts to subscribe to MovementState.

Testing

Re-run the updated AVSUM tests via the Python Runner.
Verify via Chip Tool that a subsequent command is rejected with Busy prior to the initial PTZ command initiated action completing. .

Readability checklist

The checklist below will help the reviewer finish PR review in time and keep the
code readable:

  • PR title is
    descriptive
  • Apply the
    “When in Rome…”
    rule (coding style)
  • PR size is short
  • Try to avoid "squashing" and "force-update" in commit history
  • CI time didn't increase

See: Pull Request Guidelines

Copy link
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 refactors the PTZ command handling to be asynchronous, using a callback to signal the completion of physical device movements. This change aligns with specification requirements and improves the handling of concurrent commands by introducing a 'Busy' state. The implementation introduces a PhysicalPTZCallback interface and correctly updates the delegate methods and server logic. The changes are well-structured and address the goals outlined in the description. I have a few suggestions to improve maintainability and fix a minor issue in the example implementation.

Copy link

github-actions bot commented Aug 13, 2025

PR #40565: Size comparison from 900f8c0 to 78dfce8

Full report (29 builds for bl602, bl702, bl702l, cc32xx, efr32, nrfconnect, psoc6, qpg, stm32, telink, tizen)
platform target config section 900f8c0 78dfce8 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1106520 1106520 0 0.0
RAM 178986 178986 0 0.0
bl702 lighting-app bl702+eth FLASH 659154 659154 0 0.0
RAM 134897 134897 0 0.0
bl702+wifi FLASH 837248 837248 0 0.0
RAM 124485 124485 0 0.0
bl706+mfd+rpc+littlefs FLASH 1068792 1068792 0 0.0
RAM 117325 117325 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 898230 898230 0 0.0
RAM 105628 105628 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 981944 981944 0 0.0
RAM 109820 109820 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 552454 552454 0 0.0
RAM 205104 205104 0 0.0
lock CC3235SF_LAUNCHXL FLASH 584890 584890 0 0.0
RAM 205320 205320 0 0.0
efr32 lock-app BRD4187C FLASH 959872 959872 0 0.0
RAM 122644 122644 0 0.0
BRD4338a FLASH 755184 755176 -8 -0.0
RAM 251892 251892 0 0.0
window-app BRD4187C FLASH 1053060 1053060 0 0.0
RAM 118840 118840 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 912124 912132 8 0.0
RAM 152864 152864 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1661332 1661332 0 0.0
RAM 211184 211184 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1582420 1582420 0 0.0
RAM 208440 208440 0 0.0
light cy8ckit_062s2_43012 FLASH 1453364 1453364 0 0.0
RAM 197168 197168 0 0.0
lock cy8ckit_062s2_43012 FLASH 1485692 1485692 0 0.0
RAM 224880 224880 0 0.0
qpg lighting-app qpg6200+debug FLASH 821176 821176 0 0.0
RAM 127636 127636 0 0.0
lock-app qpg6200+debug FLASH 758500 758500 0 0.0
RAM 118596 118596 0 0.0
stm32 light STM32WB5MM-DK FLASH 468220 468220 0 0.0
RAM 141360 141360 0 0.0
telink bridge-app tl7218x FLASH 709870 709870 0 0.0
RAM 93440 93440 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 798774 798774 0 0.0
RAM 44000 44000 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 789988 789988 0 0.0
RAM 100744 100744 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 716142 716142 0 0.0
RAM 54224 54224 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 749498 749498 0 0.0
RAM 77372 77372 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 726288 726288 0 0.0
RAM 36972 36972 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 606280 606280 0 0.0
RAM 112552 112552 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 822708 822712 4 0.0
RAM 99140 99140 0 0.0
tizen all-clusters-app arm unknown 5124 5124 0 0.0
FLASH 1773876 1773980 104 0.0
RAM 92428 92428 0 0.0
chip-tool-ubsan arm unknown 20772 20772 0 0.0
FLASH 21108786 21108786 0 0.0
RAM 9183200 9183200 0 0.0

Copy link

codecov bot commented Aug 13, 2025

Codecov Report

❌ Patch coverage is 23.30097% with 79 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.69%. Comparing base (233d3f7) to head (3738d0e).
⚠️ Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
...amera-av-settings-user-level-management-server.cpp 24.35% 59 Missing ⚠️
.../camera-av-settings-user-level-management-stub.cpp 0.00% 18 Missing ⚠️
.../camera-av-settings-user-level-management-server.h 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #40565      +/-   ##
==========================================
- Coverage   50.72%   50.69%   -0.03%     
==========================================
  Files        1356     1356              
  Lines       99337    99410      +73     
  Branches    12876    12902      +26     
==========================================
+ Hits        50390    50399       +9     
- Misses      48947    49011      +64     

☔ 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.

Copy link

github-actions bot commented Aug 13, 2025

PR #40565: Size comparison from 900f8c0 to e07ad8c

Full report (57 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 900f8c0 e07ad8c change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1106520 1106520 0 0.0
RAM 178986 178986 0 0.0
bl702 lighting-app bl702+eth FLASH 659154 659154 0 0.0
RAM 134897 134897 0 0.0
bl702+wifi FLASH 837248 837248 0 0.0
RAM 124485 124485 0 0.0
bl706+mfd+rpc+littlefs FLASH 1068792 1068792 0 0.0
RAM 117325 117325 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 898230 898230 0 0.0
RAM 105628 105628 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 981944 981944 0 0.0
RAM 109820 109820 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 768500 768500 0 0.0
RAM 103352 103352 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 780096 780096 0 0.0
RAM 108520 108520 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 725620 725620 0 0.0
RAM 96916 96916 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 709984 709984 0 0.0
RAM 97132 97132 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 552454 552454 0 0.0
RAM 205104 205104 0 0.0
lock CC3235SF_LAUNCHXL FLASH 584890 584890 0 0.0
RAM 205320 205320 0 0.0
efr32 lock-app BRD4187C FLASH 959872 959872 0 0.0
RAM 122644 122644 0 0.0
BRD4338a FLASH 755184 755176 -8 -0.0
RAM 251892 251892 0 0.0
window-app BRD4187C FLASH 1053060 1053060 0 0.0
RAM 118840 118840 0 0.0
esp32 all-clusters-app c3devkit DRAM 102448 102504 56 0.1
FLASH 1770078 1771000 922 0.1
IRAM 83862 83862 0 0.0
m5stack DRAM 121292 121348 56 0.0
FLASH 1717330 1718118 788 0.0
IRAM 117051 117051 0 0.0
linux air-purifier-app debug unknown 4864 4864 0 0.0
FLASH 2597460 2597460 0 0.0
RAM 116880 116880 0 0.0
all-clusters-app debug unknown 5696 5696 0 0.0
FLASH 6080926 6082746 1820 0.0
RAM 537240 537496 256 0.0
all-clusters-minimal-app debug unknown 5536 5536 0 0.0
FLASH 5213964 5213964 0 0.0
RAM 228336 228336 0 0.0
bridge-app debug unknown 5568 5568 0 0.0
FLASH 4600318 4600318 0 0.0
RAM 208600 208600 0 0.0
camera-app debug unknown 9008 9008 0 0.0
FLASH 6894715 6897355 2640 0.0
RAM 233712 233840 128 0.1
camera-controller debug unknown 9216 9216 0 0.0
FLASH 13643451 13643451 0 0.0
RAM 668960 668960 0 0.0
chip-tool debug unknown 6264 6264 0 0.0
FLASH 13693567 13693567 0 0.0
RAM 655864 655864 0 0.0
chip-tool-ipv6only arm64 unknown 40736 40736 0 0.0
FLASH 12721111 12721111 0 0.0
RAM 690824 690824 0 0.0
closure-app debug unknown 5536 5536 0 0.0
FLASH 4582100 4582100 0 0.0
RAM 200464 200464 0 0.0
fabric-admin debug unknown 5944 5944 0 0.0
FLASH 12038042 12038042 0 0.0
RAM 654872 654872 0 0.0
fabric-bridge-app debug unknown 4816 4816 0 0.0
FLASH 4399228 4399228 0 0.0
RAM 194248 194248 0 0.0
fabric-sync debug unknown 5056 5056 0 0.0
FLASH 5485573 5485573 0 0.0
RAM 493992 493992 0 0.0
lighting-app debug+rpc+ui unknown 6272 6272 0 0.0
FLASH 5470161 5470161 0 0.0
RAM 209784 209784 0 0.0
lock-app debug unknown 5496 5496 0 0.0
FLASH 4629000 4629000 0 0.0
RAM 196992 196992 0 0.0
ota-provider-app debug unknown 4856 4856 0 0.0
FLASH 4257152 4257152 0 0.0
RAM 185688 185688 0 0.0
ota-requestor-app debug unknown 4736 4736 0 0.0
FLASH 4319778 4319778 0 0.0
RAM 188512 188512 0 0.0
shell debug unknown 4312 4312 0 0.0
FLASH 2943171 2943331 160 0.0
RAM 149128 149128 0 0.0
thermostat-no-ble arm64 unknown 9856 9856 0 0.0
FLASH 4237055 4237055 0 0.0
RAM 226760 226760 0 0.0
tv-app debug unknown 5824 5824 0 0.0
FLASH 5814277 5814277 0 0.0
RAM 618336 618336 0 0.0
tv-casting-app debug unknown 5352 5352 0 0.0
FLASH 11840901 11840901 0 0.0
RAM 772648 772648 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 912124 912132 8 0.0
RAM 152864 152860 -4 -0.0
nxp contact mcxw71+release FLASH 631928 631928 0 0.0
RAM 64108 64108 0 0.0
lock mcxw71+release FLASH 742408 742408 0 0.0
RAM 65192 65192 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1661332 1661332 0 0.0
RAM 211184 211176 -8 -0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1582420 1582420 0 0.0
RAM 208440 208440 0 0.0
light cy8ckit_062s2_43012 FLASH 1453364 1453364 0 0.0
RAM 197168 197168 0 0.0
lock cy8ckit_062s2_43012 FLASH 1485692 1485692 0 0.0
RAM 224880 224880 0 0.0
qpg lighting-app qpg6200+debug FLASH 821176 821176 0 0.0
RAM 127636 127636 0 0.0
lock-app qpg6200+debug FLASH 758500 758500 0 0.0
RAM 118596 118596 0 0.0
stm32 light STM32WB5MM-DK FLASH 468220 468220 0 0.0
RAM 141360 141360 0 0.0
telink bridge-app tl7218x FLASH 709870 709870 0 0.0
RAM 93440 93440 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 798774 798774 0 0.0
RAM 44000 44000 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 789988 789988 0 0.0
RAM 100744 100744 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 716142 716142 0 0.0
RAM 54224 54224 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 749498 749498 0 0.0
RAM 77372 77372 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 726288 726288 0 0.0
RAM 36972 36972 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 606280 606280 0 0.0
RAM 112552 112552 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 822708 822712 4 0.0
RAM 99140 99140 0 0.0
tizen all-clusters-app arm unknown 5124 5124 0 0.0
FLASH 1773876 1773980 104 0.0
RAM 92428 92428 0 0.0
chip-tool-ubsan arm unknown 20772 20772 0 0.0
FLASH 21108786 21108786 0 0.0
RAM 9183200 9183200 0 0.0

Copy link

github-actions bot commented Aug 21, 2025

PR #40565: Size comparison from 233d3f7 to 7e5a2c7

Full report (33 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
platform target config section 233d3f79 7e5a2c7 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1105864 1105864 0 0.0
RAM 179018 179018 0 0.0
bl702 lighting-app bl702+eth FLASH 659198 659198 0 0.0
RAM 135025 135025 0 0.0
bl702+wifi FLASH 836370 836370 0 0.0
RAM 124509 124509 0 0.0
bl706+mfd+rpc+littlefs FLASH 1068378 1068378 0 0.0
RAM 117349 117349 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 897816 897816 0 0.0
RAM 105660 105660 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 981530 981530 0 0.0
RAM 109844 109844 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 768324 768324 0 0.0
RAM 103392 103392 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 779944 779944 0 0.0
RAM 108560 108560 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 725516 725516 0 0.0
RAM 96932 96932 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 709992 709992 0 0.0
RAM 97140 97140 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 552230 552230 0 0.0
RAM 205120 205120 0 0.0
lock CC3235SF_LAUNCHXL FLASH 584546 584546 0 0.0
RAM 205352 205352 0 0.0
efr32 lock-app BRD4187C FLASH 959792 959792 0 0.0
RAM 122696 122696 0 0.0
BRD4338a FLASH 755224 755216 -8 -0.0
RAM 252020 252020 0 0.0
window-app BRD4187C FLASH 1053908 1053908 0 0.0
RAM 118892 118892 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 911748 911760 12 0.0
RAM 152894 152895 1 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1661556 1661572 16 0.0
RAM 211216 211216 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1582884 1582884 0 0.0
RAM 208480 208480 0 0.0
light cy8ckit_062s2_43012 FLASH 1453844 1453844 0 0.0
RAM 197200 197200 0 0.0
lock cy8ckit_062s2_43012 FLASH 1486172 1486172 0 0.0
RAM 224920 224920 0 0.0
qpg lighting-app qpg6200+debug FLASH 820952 820952 0 0.0
RAM 127644 127644 0 0.0
lock-app qpg6200+debug FLASH 758284 758284 0 0.0
RAM 118604 118604 0 0.0
realtek light-switch-app rtl8777g FLASH 704008 704008 0 0.0
RAM 106676 106676 0 0.0
lighting-app rtl8777g FLASH 755592 755592 0 0.0
RAM 127056 127056 0 0.0
stm32 light STM32WB5MM-DK FLASH 468028 468028 0 0.0
RAM 141400 141400 0 0.0
telink bridge-app tl7218x FLASH 709978 709978 0 0.0
RAM 93472 93472 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 798890 798890 0 0.0
RAM 44032 44032 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 790104 790104 0 0.0
RAM 100776 100776 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 716262 716262 0 0.0
RAM 54260 54260 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 749618 749618 0 0.0
RAM 77408 77408 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 726408 726408 0 0.0
RAM 37008 37008 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 606396 606396 0 0.0
RAM 112584 112584 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 822824 822828 4 0.0
RAM 99172 99172 0 0.0

@bzbarsky-apple
Copy link
Contributor

/gemini review

Copy link
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 refactors the handling of physical PTZ commands to be asynchronous, using a callback to signal completion. This is a significant improvement, aligning with the specification requirements and allowing for better handling of busy states. A new MovementState attribute is introduced to track the camera's physical movement, which is a great addition for state management. The changes are comprehensive, updating the server implementation, example applications, and test scripts accordingly.

My review has identified a few areas for improvement. There are a couple of potential null pointer dereferences in the example/stub code that should be addressed for robustness. I also found an inconsistency in how the new MovementState attribute is updated, which could lead to reporting issues. Additionally, there are several typos in comments and documentation that should be corrected for clarity. The Python test updates are well-implemented to handle the new asynchronous flow, though I noticed a minor copy-paste error in one of the test scripts.

//
DeviceLayer::SystemLayer().ScheduleLambda([callback] { callback->OnPhysicalMovementComplete(Status::Success); });
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, so if the cluster gets torn down while this lambda is pending.... It's pretty dangerous for apps to copy this pattern.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What would the preferred pattern be for the all-clusters stub?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you have a few options (both here and in CameraAVSettingsUserLevelManager over in camera-app):

  1. Keep track of the cluster lifetime somehow in the app code, check that it's alive inside the lambda/timer callback before invoking things on it.
  2. Fix CameraAvSettingsUserLevelMgmtServer to mDelegate.SetServer(nullptr) in CameraAvSettingsUserLevelMgmtServer (probably a good idea anyway, to avoid use-after-free), then check that GetServer() is not null when the lambda runs or the timer fires. Of course that then pushes the problem a bit further out: you have to make sure the delegate you call GetServer() on is not destroyed at that point.

Copy link

github-actions bot commented Aug 21, 2025

PR #40565: Size comparison from 233d3f7 to 9ecd726

Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
platform target config section 233d3f79 9ecd726 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1105864 1105874 10 0.0
RAM 179018 179018 0 0.0
bl702 lighting-app bl702+eth FLASH 659198 659208 10 0.0
RAM 135025 135025 0 0.0
bl702+wifi FLASH 836370 836380 10 0.0
RAM 124509 124509 0 0.0
bl706+mfd+rpc+littlefs FLASH 1068378 1068388 10 0.0
RAM 117349 117349 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 897816 897826 10 0.0
RAM 105660 105660 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 981530 981540 10 0.0
RAM 109844 109844 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 768324 768324 0 0.0
RAM 103392 103392 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 779944 779944 0 0.0
RAM 108560 108560 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 725516 725548 32 0.0
RAM 96932 96932 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 709992 710024 32 0.0
RAM 97140 97140 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 552230 552246 16 0.0
RAM 205120 205120 0 0.0
lock CC3235SF_LAUNCHXL FLASH 584546 584562 16 0.0
RAM 205352 205352 0 0.0
efr32 lock-app BRD4187C FLASH 959792 959824 32 0.0
RAM 122696 122696 0 0.0
BRD4338a FLASH 755224 755248 24 0.0
RAM 252020 252020 0 0.0
window-app BRD4187C FLASH 1053908 1053940 32 0.0
RAM 118892 118892 0 0.0
esp32 all-clusters-app c3devkit DRAM 102536 102536 0 0.0
FLASH 1769488 1770898 1410 0.1
IRAM 83862 83862 0 0.0
m5stack DRAM 121388 121388 0 0.0
FLASH 1716766 1718034 1268 0.1
IRAM 117051 117051 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 911748 911784 36 0.0
RAM 152894 152895 1 0.0
nxp contact mcxw71+release FLASH 632424 632448 24 0.0
RAM 64124 64124 0 0.0
lock mcxw71+release FLASH 742208 742240 32 0.0
RAM 65200 65200 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1661556 1661604 48 0.0
RAM 211216 211216 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1582884 1582916 32 0.0
RAM 208480 208480 0 0.0
light cy8ckit_062s2_43012 FLASH 1453844 1453876 32 0.0
RAM 197200 197200 0 0.0
lock cy8ckit_062s2_43012 FLASH 1486172 1486204 32 0.0
RAM 224920 224920 0 0.0
qpg lighting-app qpg6200+debug FLASH 820952 820984 32 0.0
RAM 127644 127644 0 0.0
lock-app qpg6200+debug FLASH 758284 758316 32 0.0
RAM 118604 118604 0 0.0
realtek light-switch-app rtl8777g FLASH 704008 704040 32 0.0
RAM 106676 106676 0 0.0
lighting-app rtl8777g FLASH 755592 755624 32 0.0
RAM 127056 127056 0 0.0
stm32 light STM32WB5MM-DK FLASH 468028 468060 32 0.0
RAM 141400 141400 0 0.0
telink bridge-app tl7218x FLASH 709978 709988 10 0.0
RAM 93472 93472 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 798890 798900 10 0.0
RAM 44032 44032 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 790104 790114 10 0.0
RAM 100776 100776 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 716262 716272 10 0.0
RAM 54260 54260 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 749618 749628 10 0.0
RAM 77408 77408 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 726408 726418 10 0.0
RAM 37008 37008 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 606396 606406 10 0.0
RAM 112584 112584 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 822824 822838 14 0.0
RAM 99172 99172 0 0.0

Copy link

github-actions bot commented Aug 22, 2025

PR #40565: Size comparison from 233d3f7 to b2e2a5f

Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
platform target config section 233d3f79 b2e2a5fe change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1105864 1105874 10 0.0
RAM 179018 179018 0 0.0
bl702 lighting-app bl702+eth FLASH 659198 659208 10 0.0
RAM 135025 135025 0 0.0
bl702+wifi FLASH 836370 836380 10 0.0
RAM 124509 124509 0 0.0
bl706+mfd+rpc+littlefs FLASH 1068378 1068388 10 0.0
RAM 117349 117349 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 897816 897826 10 0.0
RAM 105660 105660 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 981530 981540 10 0.0
RAM 109844 109844 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 768324 768324 0 0.0
RAM 103392 103392 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 779944 779944 0 0.0
RAM 108560 108560 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 725516 725548 32 0.0
RAM 96932 96932 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 709992 710024 32 0.0
RAM 97140 97140 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 552230 552246 16 0.0
RAM 205120 205120 0 0.0
lock CC3235SF_LAUNCHXL FLASH 584546 584562 16 0.0
RAM 205352 205352 0 0.0
efr32 lock-app BRD4187C FLASH 959792 959824 32 0.0
RAM 122696 122696 0 0.0
BRD4338a FLASH 755224 755248 24 0.0
RAM 252020 252020 0 0.0
window-app BRD4187C FLASH 1053908 1053940 32 0.0
RAM 118892 118892 0 0.0
esp32 all-clusters-app c3devkit DRAM 102536 102536 0 0.0
FLASH 1769488 1770898 1410 0.1
IRAM 83862 83862 0 0.0
m5stack DRAM 121388 121388 0 0.0
FLASH 1716766 1718034 1268 0.1
IRAM 117051 117051 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 911748 911784 36 0.0
RAM 152894 152895 1 0.0
nxp contact mcxw71+release FLASH 632424 632448 24 0.0
RAM 64124 64124 0 0.0
lock mcxw71+release FLASH 742208 742240 32 0.0
RAM 65200 65200 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1661556 1661604 48 0.0
RAM 211216 211216 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1582884 1582916 32 0.0
RAM 208480 208480 0 0.0
light cy8ckit_062s2_43012 FLASH 1453844 1453876 32 0.0
RAM 197200 197200 0 0.0
lock cy8ckit_062s2_43012 FLASH 1486172 1486204 32 0.0
RAM 224920 224920 0 0.0
qpg lighting-app qpg6200+debug FLASH 820952 820984 32 0.0
RAM 127644 127644 0 0.0
lock-app qpg6200+debug FLASH 758284 758316 32 0.0
RAM 118604 118604 0 0.0
realtek light-switch-app rtl8777g FLASH 704008 704040 32 0.0
RAM 106676 106676 0 0.0
lighting-app rtl8777g FLASH 755592 755624 32 0.0
RAM 127056 127056 0 0.0
stm32 light STM32WB5MM-DK FLASH 468028 468060 32 0.0
RAM 141400 141400 0 0.0
telink bridge-app tl7218x FLASH 709978 709988 10 0.0
RAM 93472 93472 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 798890 798900 10 0.0
RAM 44032 44032 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 790104 790114 10 0.0
RAM 100776 100776 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 716262 716272 10 0.0
RAM 54260 54260 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 749618 749628 10 0.0
RAM 77408 77408 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 726408 726418 10 0.0
RAM 37008 37008 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 606396 606406 10 0.0
RAM 112584 112584 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 822824 822838 14 0.0
RAM 99172 99172 0 0.0

@@ -72,98 +72,96 @@ CHIP_ERROR CameraAvSettingsUserLevelMgmtServer::Init()

// All of the attributes are dependent on Feature Flags being set, ensure that this is the case
//
if (SupportsOptAttr(OptionalAttributes::kMptzPosition))
if (SupportsOptAttr(OptionalAttributes::kMptzPosition) !=
Copy link
Contributor

Choose a reason for hiding this comment

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

As a followup: instead of having this setup where the cluster can be mis-configured, why not just remove the concept of OptionalAttributes::kMptzPosition and use the feature flags directly instead wherever it's being used right now?

Same for the other bits.

//
DeviceLayer::SystemLayer().ScheduleLambda([callback] { callback->OnPhysicalMovementComplete(Status::Success); });
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you have a few options (both here and in CameraAVSettingsUserLevelManager over in camera-app):

  1. Keep track of the cluster lifetime somehow in the app code, check that it's alive inside the lambda/timer callback before invoking things on it.
  2. Fix CameraAvSettingsUserLevelMgmtServer to mDelegate.SetServer(nullptr) in CameraAvSettingsUserLevelMgmtServer (probably a good idea anyway, to avoid use-after-free), then check that GetServer() is not null when the lambda runs or the timer fires. Of course that then pushes the problem a bit further out: you have to make sure the delegate you call GetServer() on is not destroyed at that point.

Copy link

github-actions bot commented Aug 22, 2025

PR #40565: Size comparison from 233d3f7 to 4c6a936

Increases above 0.2%:

platform target config section 233d3f79 4c6a936 change % change
efr32 lock-app BRD4187C RAM 122696 126408 3712 3.0
BRD4338a RAM 252020 255732 3712 1.5
window-app BRD4187C RAM 118892 122604 3712 3.1
Full report (16 builds for efr32, esp32, nrfconnect, nxp, telink)
platform target config section 233d3f79 4c6a936 change % change
efr32 lock-app BRD4187C FLASH 959792 959824 32 0.0
RAM 122696 126408 3712 3.0
BRD4338a FLASH 755224 755264 40 0.0
RAM 252020 255732 3712 1.5
window-app BRD4187C FLASH 1053908 1053940 32 0.0
RAM 118892 122604 3712 3.1
esp32 all-clusters-app c3devkit DRAM 102536 102536 0 0.0
FLASH 1769488 1770898 1410 0.1
IRAM 83862 83862 0 0.0
m5stack DRAM 121388 121388 0 0.0
FLASH 1716766 1718010 1244 0.1
IRAM 117051 117051 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 911748 912232 484 0.1
RAM 152894 152899 5 0.0
nxp contact mcxw71+release FLASH 632424 632472 48 0.0
RAM 64124 64124 0 0.0
lock mcxw71+release FLASH 742208 742264 56 0.0
RAM 65200 65200 0 0.0
telink bridge-app tl7218x FLASH 709978 709988 10 0.0
RAM 93472 93472 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 798890 798900 10 0.0
RAM 44032 44032 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 790104 790114 10 0.0
RAM 100776 100776 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 716262 716272 10 0.0
RAM 54260 54260 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 749618 749628 10 0.0
RAM 77408 77408 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 726408 726418 10 0.0
RAM 37008 37008 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 606396 606406 10 0.0
RAM 112584 112584 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 822824 822838 14 0.0
RAM 99172 99172 0 0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

5 participants