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

Initial version of Joint Fabric implementation #34637

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vijs
Copy link
Collaborator

@vijs vijs commented Jul 30, 2024

Initial version of the Joint Fabric implementation 34635

Added support for JCM (5.6.3. Joint Commissioning Method)

Fixes #34635

Copy link

semanticdiff-com bot commented Jul 30, 2024

Review changes with SemanticDiff.

Analyzed 11 of 73 files.

Overall, the semantic diff is 1% smaller than the GitHub diff.

File Information
Filename Status
zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h Unsupported file format
zzz_generated/chip-tool/zap-generated/cluster/Commands.h Unsupported file format
zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp Unsupported file format
zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h Unsupported file format
zzz_generated/app-common/app-common/zap-generated/callback.h Unsupported file format
zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h Unsupported file format
zzz_generated/app-common/app-common/zap-generated/cluster-enums.h Unsupported file format
zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp Unsupported file format
zzz_generated/app-common/app-common/zap-generated/cluster-objects.h Unsupported file format
zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h Unsupported file format
zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h Unsupported file format
zzz_generated/app-common/app-common/zap-generated/ids/Commands.h Unsupported file format
zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp Unsupported file format
zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRClusters.h Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm Unsupported file format
src/crypto/CHIPCryptoPAL.h Unsupported file format
src/controller/AutoCommissioner.cpp Unsupported file format
src/controller/AutoCommissioner.h Unsupported file format
src/controller/CHIPDeviceController.cpp Unsupported file format
src/controller/CHIPDeviceController.h Unsupported file format
src/controller/CommissioningDelegate.cpp Unsupported file format
src/controller/CommissioningDelegate.h Unsupported file format
src/controller/ExampleOperationalCredentialsIssuer.cpp Unsupported file format
src/controller/ExampleOperationalCredentialsIssuer.h Unsupported file format
src/controller/OperationalCredentialsDelegate.cpp Unsupported file format
src/controller/OperationalCredentialsDelegate.h Unsupported file format
✔️ src/controller/python/chip/clusters/CHIPClusters.py Analyzed
✔️ src/controller/python/chip/clusters/Objects.py Analyzed
✔️ src/controller/python/chip/clusters/__init__.py 6.25% smaller
src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp Unsupported file format
src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp Unsupported file format
src/controller/java/generated/java/matter/controller/cluster/files.gni Unsupported file format
src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterQueuedPresetStruct.kt Unsupported file format
src/controller/java/generated/java/matter/controller/cluster/clusters/JointFabricPkiCluster.kt Unsupported file format
✔️ src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java Analyzed
✔️ src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java Analyzed
✔️ src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java Analyzed
✔️ src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java Analyzed
✔️ src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java Analyzed
src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterQueuedPresetStruct.kt Unsupported file format
src/controller/data_model/controller-clusters.matter Unsupported file format
src/controller/data_model/controller-clusters.zap Unsupported file format
src/app/BUILD.gn Unsupported file format
✔️ src/app/zap_cluster_list.json Analyzed
✔️ src/app/zap-templates/zcl/zcl-with-test-extensions.json Analyzed
✔️ src/app/zap-templates/zcl/zcl.json Analyzed
src/app/zap-templates/zcl/data-model/all.xml Unsupported file format
src/app/zap-templates/zcl/data-model/chip/joint-fabric-pki-cluster.xml Unsupported file format
src/app/zap-templates/zcl/data-model/chip/matter-devices.xml Unsupported file format
src/app/clusters/joint-fabric-pki-server/joint-fabric-pki-server.cpp Unsupported file format
src/app/clusters/joint-fabric-pki-server/joint-fabric-pki-server.h Unsupported file format
scripts/rules.matterlint Unsupported file format
examples/platform/linux/AppMain.cpp Unsupported file format
examples/platform/linux/Options.cpp Unsupported file format
examples/platform/linux/Options.h Unsupported file format
examples/chip-tool/commands/pairing/PairingCommand.cpp Unsupported file format
examples/chip-tool/commands/pairing/PairingCommand.h Unsupported file format
examples/all-clusters-app/all-clusters-common/all-clusters-app.matter Unsupported file format
examples/all-clusters-app/all-clusters-common/all-clusters-app.zap Unsupported file format
docs/zap_clusters.md Unsupported file format
.github/workflows/tests.yaml Unsupported file format

Copy link
Contributor

@andy31415 andy31415 left a comment

Choose a reason for hiding this comment

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

Please split this up to something more manageable. A PR of 300K lines added and 240K removed is not reviewable in any practical sense.

I imagine a lot of this is code generated files, so please start with a PR for those (XML for data first, then maybe some commands individually)

Comment on lines +500 to +530
namespace {
static constexpr size_t kFabricId = 1;

ExampleOperationalCredentialsIssuer gOpCredsIssuer(kFabricId);
PersistentStorage gStorage;

CHIP_ERROR PrepareJointFabricCluster()
{
SetPersistentStorageDelegate(&gStorage);
SetOperationalCredentialsIssuer(&gOpCredsIssuer);
SetChipToolKvs(LinuxDeviceOptions::GetInstance().chipToolKvs);
return CHIP_NO_ERROR;
}
} // namespace
Copy link
Contributor

Choose a reason for hiding this comment

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

Linux apps all share this. Having these global setters and fixed fabric ID breaks other assumptions of the Linux examples

ExampleOperationalCredentialsIssuer gOpCredsIssuer(kFabricId);
PersistentStorage gStorage;

CHIP_ERROR PrepareJointFabricCluster()
Copy link
Contributor

Choose a reason for hiding this comment

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

The entire joint fabric feature should be conditional on build,and should be in a different example, not all-clusters-app. Please do like what Fabric Sync did, and make your own special samples for that whole method that doesn't bloat and complexify the already very complex all-clusters-app

@@ -427,6 +427,7 @@ static_library("app") {
output_name = "libCHIPDataModel"

sources = [
"${chip_root}/src/controller/ExamplePersistentStorage.cpp",
Copy link
Contributor

Choose a reason for hiding this comment

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

This must be a separate library that is NOT a dependency of libCHIPDataModel since it's common code shared by all. Specific examples have to be split AND injectable. Not baked-in.

@@ -473,6 +474,7 @@ static_library("app") {
"${chip_root}/src/messaging",
"${chip_root}/src/protocols/interaction_model",
"${chip_root}/src/system",
"${chip_root}/third_party/inipp",
Copy link
Contributor

Choose a reason for hiding this comment

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

Do not add 3rd party deps to libCHIPDataModel without justification

Copy link
Contributor

Choose a reason for hiding this comment

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

inipp does not seem to make sense for embedded devices

Comment on lines -76 to -79

[[deprecated("This constant is no longer used by common code and should be replaced by kMIN_CSR_Buffer_Size. Checks that a CSR is "
"<= kMAX_CSR_Buffer_size must be updated. This remains to keep valid buffers working from previous public API "
"usage.")]] constexpr size_t kMAX_CSR_Buffer_Size = 255;
Copy link
Contributor

Choose a reason for hiding this comment

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

You cannot change this deprecation without justification. Changing this value will break stuff.

@andy31415
Copy link
Contributor

@vijs I think the huge delta is due to the kotlin formatter not being run: all kt files changed and all look unformatted (quite ugly)

@vijs vijs force-pushed the feature/joint_fabric branch from feef2f1 to 42f7e5d Compare July 30, 2024 22:50
@vijs vijs requested a review from andy31415 July 30, 2024 22:51
@vijs
Copy link
Collaborator Author

vijs commented Jul 30, 2024

Please split this up to something more manageable. A PR of 300K lines added and 240K removed is not reviewable in any practical sense.

I imagine a lot of this is code generated files, so please start with a PR for those (XML for data first, then maybe some commands individually)

Thank you for your suggestions. I’ve regenerated and restyled the files. Now, only 73 files have changed.

@vijs vijs closed this Jul 30, 2024
@vijs vijs reopened this Jul 30, 2024
@vijs vijs dismissed andy31415’s stale review July 30, 2024 22:56

Regenerated and restyled the files. Now, only 73 files have changed.

Copy link

github-actions bot commented Jul 30, 2024

PR #34637: Size comparison from b426fde to 42f7e5d

Full report (27 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, mbed, nxp, qpg)
platform target config section b426fde 42f7e5d change % change
bl602 lighting-app bl602 FLASH 1277116 1277116 0 0.0
RAM 95888 95888 0 0.0
bl602+mfd FLASH 1291374 1291374 0 0.0
RAM 96040 96040 0 0.0
bl602+rpc FLASH 1316084 1316084 0 0.0
RAM 104312 104312 0 0.0
bl702 lighting-app bl702 FLASH 1098268 1098268 0 0.0
RAM 15241 15241 0 0.0
bl702+mfd FLASH 1108962 1108962 0 0.0
RAM 15385 15385 0 0.0
bl702+rpc FLASH 1188334 1188334 0 0.0
RAM 24237 24237 0 0.0
bl706-eth FLASH 881302 881302 0 0.0
RAM 27344 27344 0 0.0
bl706-wifi FLASH 1134400 1134400 0 0.0
RAM 14677 14677 0 0.0
bl702l lighting-app bl702l FLASH 1085422 1085422 0 0.0
RAM 21796 21796 0 0.0
bl702l+mfd FLASH 1096428 1096428 0 0.0
RAM 21948 21948 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 802352 802352 0 0.0
RAM 109844 109844 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 817044 817044 0 0.0
RAM 117444 117444 0 0.0
lock-mtd LP_EM_CC1354P10_6 FLASH 809024 809024 0 0.0
RAM 111724 111724 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 762788 762788 0 0.0
RAM 105864 105864 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 747440 747440 0 0.0
RAM 106056 106056 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 610150 610150 0 0.0
RAM 205380 205380 0 0.0
lock CC3235SF_LAUNCHXL FLASH 652630 652630 0 0.0
RAM 205620 205620 0 0.0
efr32 lighting-app BRD4187C FLASH 929424 929424 0 0.0
RAM 135148 135148 0 0.0
lock-app BRD4338a FLASH 735092 735092 0 0.0
RAM 208436 208436 0 0.0
window-app BRD4187C FLASH 1015188 1015188 0 0.0
RAM 127084 127084 0 0.0
mbed lock-app-release cy8cproto_062_4343w FLASH 1503716 1503716 0 0.0
RAM 227296 227296 0 0.0
nxp contact k32w0+release FLASH 576412 576412 0 0.0
RAM 70416 70416 0 0.0
k32w1+release FLASH 592120 592120 0 0.0
RAM 74456 74456 0 0.0
light k32w0+release FLASH 612040 612040 0 0.0
RAM 69920 69920 0 0.0
k32w1+release FLASH 676952 676952 0 0.0
RAM 83232 83232 0 0.0
qpg lighting-app qpg6105+debug FLASH 655108 655108 0 0.0
RAM 105148 105148 0 0.0
lock-app qpg6105+debug FLASH 612544 612544 0 0.0
RAM 99632 99632 0 0.0

Copy link
Contributor

@andy31415 andy31415 left a comment

Choose a reason for hiding this comment

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

Please separate out datamodel updates + codegen from implementation in separate PRs. start with xml creation/update and codegen as single stand-alone PR (without any app code).

Review-wise those are very different: on xml we just validate against spec text, for implementation we have to review logic. You can do the first PR and in parallel while it is being reviewed, you can address the comments you received in this PR and fix some compilation issues that seem to exist.

Copy link
Contributor

@robszewczyk robszewczyk left a comment

Choose a reason for hiding this comment

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

Other reviewers that would typically be scrutinizing the new code are likely engaged with 1.4 tasks. Please do not reach out to them until August 19 at the earliest. I will dismiss my CR on August 19.

@mergify mergify bot added the conflict label Aug 9, 2024
@robszewczyk robszewczyk dismissed their stale review September 10, 2024 15:46

Dismissing the CR now that the 1.4 test harness tag has been cut

@pullapprove pullapprove bot requested a review from jtov-sfy September 19, 2024 21:33
@mergify mergify bot added conflict and removed conflict labels Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Implement Joint Fabric Feature
4 participants