[Darwin] add implementations for Darwin cluster extensions#43498
Conversation
headers were correctly generated, but not matching implementations
There was a problem hiding this comment.
Pull request overview
Adds missing Objective-C implementation generation for “Darwin cluster private extensions” so generated private headers have matching .mm implementations in the Darwin framework codegen pipeline.
Changes:
- Generate private-extension implementations for manufacturer-specific command params payload objects.
- Generate
PrivateExtensionscategories forMTRCluster*andMTRBaseCluster*to support private manufacturer-specific commands/attributes. - Extend private attribute decoding and “attribute specified” checks to cover private-extension attributes.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc_Private-src.zapt | Adds implementations for manufacturer-specific command payload param classes for private extensions. |
| src/darwin/Framework/CHIP/templates/MTRClusters_Private-src.zapt | Adds MTRCluster* (PrivateExtensions) command + attribute read/write implementations for private extensions. |
| src/darwin/Framework/CHIP/templates/MTRBaseClusters_Private-src.zapt | Adds MTRBaseCluster* (PrivateExtensions) command + attribute implementations for private extensions. |
| src/darwin/Framework/CHIP/templates/MTRAttributeTLVValueDecoder_Private-src.zapt | Adds private-extension attribute TLV decoding and dispatch for those clusters. |
| src/darwin/Framework/CHIP/templates/MTRAttributeSpecifiedCheck_Private-src.zapt | Adds private-extension attribute “is specified” checks and dispatch for those clusters. |
src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc_Private-src.zapt
Show resolved
Hide resolved
There was a problem hiding this comment.
Code Review
This pull request adds implementations for Darwin cluster extensions, which are manufacturer-specific, within the Matter (CHIP) framework. A security audit found no significant vulnerabilities, with the implementation adhering to project security architecture and best practices. The changes are consistent and appear correct, though I have a few suggestions to improve conciseness in the templates by combining nested if conditions, in line with the repository's style guide.
src/darwin/Framework/CHIP/templates/MTRAttributeSpecifiedCheck_Private-src.zapt
Show resolved
Hide resolved
src/darwin/Framework/CHIP/templates/MTRAttributeSpecifiedCheck_Private-src.zapt
Show resolved
Hide resolved
src/darwin/Framework/CHIP/templates/MTRAttributeTLVValueDecoder_Private-src.zapt
Show resolved
Hide resolved
src/darwin/Framework/CHIP/templates/MTRAttributeTLVValueDecoder_Private-src.zapt
Show resolved
Hide resolved
src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc_Private-src.zapt
Show resolved
Hide resolved
Prevents generating a (PrivateMethods) category on a params class that was never implemented when isSupported returns false. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
PR #43498: Size comparison from aba5ca5 to c9571d3 Full report (34 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #43498 +/- ##
==========================================
+ Coverage 54.03% 54.05% +0.01%
==========================================
Files 1546 1549 +3
Lines 106642 106695 +53
Branches 13316 13318 +2
==========================================
+ Hits 57627 57673 +46
- Misses 49015 49022 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…hip#43498) * add implementations for DarwinClustersWithPrivateExtensions headers were correctly generated, but not matching implementations * Move command_params_internal_methods inside isSupported guard Prevents generating a (PrivateMethods) category on a params class that was never implemented when isSupported returns false. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Before changes, headers were correctly generated, but not matching implementations. Add matching implementations for codegen.
Testing
./scripts/tools/zap_regen_all.py --type all; check for no changes. (no darwin-specific cluster extensions are specified in config.)Readability checklist
The checklist below will help the reviewer finish PR review in time and keep the
code readable:
descriptive
“When in Rome…”
rule (coding style)
See: Pull Request Guidelines