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

[chip-tool] Add Enhanced Commissioning Support (T&C Flow via Local DCL) to chip-tool #37049

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

Conversation

vivien-apple
Copy link
Contributor

Problem

This PR introduces Enhanced Commissioning support to chip-tool. Specifically, it checks the DCL (Device Compliance Ledger) data during the pairing process to:

  1. Display applicable Terms & Conditions (T&C).
  2. Pause until the user accepts or declines those T&Cs.
  3. Update the commissioning parameters based on the user’s response.

This enhancement ensures that devices requiring T&Cs can be properly commissioned using updated chip-tool workflows (this is different from #36863 where the T&C are not displayed).

Implementation Details

  • DCL Queries: New commands have been added to retrieve and display T&Cs from the (local) DCL server.
  • User Interaction: If T&Cs are available, the tool will display them and wait for user confirmation.
  • Commissioning Parameters: After confirmation, the tool automatically includes the user’s decision in the commissioning flow (e.g., setting the correct parameters or rejecting the process if T&Cs are declined).

Testing

Note: A local DCL server must be used because the official DCL does not yet have the proper keys for this feature.

Local DCL Server Testing

  1. Run the local DCL server:
$ ./examples/chip-tool/commands/dcl/test_dcl_server.py
  1. Validate DCL content:
  • Retrieve DCL data for a payload:
 $ ./out/debug/standalone/chip-tool dcl tc-by-payload MT:-24J029Q00KA0648G00 --hostname localhost --port 4443
  • Display T&Cs for a payload:
$ ./out/debug/standalone/chip-tool dcl tc-display-by-payload MT:-24J029Q00KA0648G00 --hostname localhost --port 4443
  • Display T&Cs with optional country/language codes:
$ ./out/debug/standalone/chip-tool dcl tc-display-by-payload MT:-24J029Q00KA0648G00 --hostname localhost --port 4443 --country-code US --language-code es

Commissioning a Test Device

  1. Set up the All-Clusters App:
# Build the all-clusters-app with T&C enabled
$ (./scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug/standalone/ chip_terms_and_conditions_required="true")
# Run the all-clusters-app with specific T&C parameters
$ ./out/debug/standalone/chip-all-clusters-app --interface 1 --KVS /tmp/chip_kvs_tc_required --tc-version 1 --tc-required 3 
  1. Pair using the new T&C flow:
$ ./out/debug/standalone/chip-tool pairing code 0x12344321 MT:-24J029Q00KA0648G00 --use-dcl --dcl-hostname localhost --dcl-port 4443

Copy link

semanticdiff-com bot commented Jan 13, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  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
  examples/chip-tool/BUILD.gn Unsupported file format
  examples/chip-tool/commands/dcl/Commands.h Unsupported file format
  examples/chip-tool/commands/dcl/DCLClient.cpp Unsupported file format
  examples/chip-tool/commands/dcl/DCLClient.h Unsupported file format
  examples/chip-tool/commands/dcl/DCLCommands.h Unsupported file format
  examples/chip-tool/commands/dcl/DisplayTermsAndConditions.cpp Unsupported file format
  examples/chip-tool/commands/dcl/DisplayTermsAndConditions.h Unsupported file format
  examples/chip-tool/commands/dcl/HTTPSRequest.cpp Unsupported file format
  examples/chip-tool/commands/dcl/HTTPSRequest.h Unsupported file format
  examples/chip-tool/commands/dcl/JsonSchemaMacros.cpp Unsupported file format
  examples/chip-tool/commands/dcl/JsonSchemaMacros.h Unsupported file format
  examples/chip-tool/commands/dcl/test_dcl_server.py  0% smaller
  examples/chip-tool/commands/pairing/PairingCommand.cpp Unsupported file format
  examples/chip-tool/commands/pairing/PairingCommand.h Unsupported file format
  examples/chip-tool/main.cpp 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
  src/app/clusters/general-commissioning-server/general-commissioning-server.cpp Unsupported file format
  third_party/boringssl/repo/BUILD.gn Unsupported file format

Copy link

github-actions bot commented Jan 14, 2025

PR #37049: Size comparison from 211d33a to ae03df5

Increases above 0.2%:

platform target config section 211d33a ae03df5 change % change
linux chip-tool debug unknown 5984 6120 136 2.3
FLASH 12867152 12921146 53994 0.4
Full report (67 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink)
platform target config section 211d33a ae03df5 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094560 1094560 0 0.0
RAM 103346 103346 0 0.0
bl702 lighting-app bl702+eth FLASH 652366 652622 256 0.0
RAM 25353 25353 0 0.0
bl702+wifi FLASH 830546 830546 0 0.0
RAM 14093 14093 0 0.0
bl706+mfd+rpc+littlefs FLASH 1057832 1057832 0 0.0
RAM 23949 23949 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 890856 890856 0 0.0
RAM 18624 18624 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 973816 973816 0 0.0
RAM 16472 16472 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 840176 840208 32 0.0
RAM 123552 123552 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 825692 825740 48 0.0
RAM 125440 125440 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 772620 772668 48 0.0
RAM 113916 113916 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 756816 756848 32 0.0
RAM 114116 114116 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 540041 540089 48 0.0
RAM 205304 205304 0 0.0
lock CC3235SF_LAUNCHXL FLASH 574209 574241 32 0.0
RAM 205448 205448 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 681569 681601 32 0.0
RAM 78596 78596 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 701413 701445 32 0.0
RAM 81236 81236 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 701413 701445 32 0.0
RAM 81236 81236 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 658357 658389 32 0.0
RAM 73664 73664 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 618153 618193 40 0.0
RAM 71588 71588 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 637789 637829 40 0.0
RAM 74132 74132 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 637789 637829 40 0.0
RAM 74132 74132 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 637601 637633 32 0.0
RAM 74596 74596 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 657317 657349 32 0.0
RAM 77140 77140 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 657317 657349 32 0.0
RAM 77140 77140 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 614213 614253 40 0.0
RAM 68684 68684 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 634065 634105 40 0.0
RAM 71316 71316 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 634065 634105 40 0.0
RAM 71316 71316 0 0.0
efr32 lock-app BRD4187C FLASH 932468 932500 32 0.0
RAM 160068 160068 0 0.0
BRD4338a FLASH 749232 749336 104 0.0
RAM 233196 233196 0 0.0
window-app BRD4187C FLASH 1026864 1026984 120 0.0
RAM 128172 128172 0 0.0
esp32 all-clusters-app c3devkit DRAM 95192 95192 0 0.0
FLASH 1541904 1542078 174 0.0
IRAM 82552 82552 0 0.0
m5stack DRAM 116172 116172 0 0.0
FLASH 1548458 1548642 184 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4752 4752 0 0.0
FLASH 2723229 2724111 882 0.0
RAM 133160 133160 0 0.0
all-clusters-app debug unknown 5560 5560 0 0.0
FLASH 5996466 5997412 946 0.0
RAM 526072 526136 64 0.0
all-clusters-minimal-app debug unknown 5456 5456 0 0.0
FLASH 5341652 5342534 882 0.0
RAM 243072 243072 0 0.0
bridge-app debug unknown 5472 5472 0 0.0
FLASH 4696806 4697688 882 0.0
RAM 221824 221824 0 0.0
chip-tool debug unknown 5984 6120 136 2.3
FLASH 12867152 12921146 53994 0.4
RAM 587002 587538 536 0.1
fabric-admin debug unknown 5808 5808 0 0.0
FLASH 11274263 11274263 0 0.0
RAM 587346 587346 0 0.0
fabric-bridge-app debug unknown 4728 4728 0 0.0
FLASH 4521756 4522638 882 0.0
RAM 208928 208928 0 0.0
fabric-sync debug unknown 4968 4968 0 0.0
FLASH 5622981 5623861 880 0.0
RAM 477880 477880 0 0.0
lighting-app debug+rpc+ui unknown 6136 6136 0 0.0
FLASH 5631329 5632209 880 0.0
RAM 232072 232072 0 0.0
lock-app debug unknown 5408 5408 0 0.0
FLASH 4744568 4745450 882 0.0
RAM 208072 208072 0 0.0
ota-provider-app debug unknown 4768 4768 0 0.0
FLASH 4372108 4372990 882 0.0
RAM 201744 201744 0 0.0
ota-requestor-app debug unknown 4720 4720 0 0.0
FLASH 4510120 4511002 882 0.0
RAM 206312 206312 0 0.0
shell debug unknown 4248 4248 0 0.0
FLASH 3023197 3024141 944 0.0
RAM 160792 160856 64 0.0
tv-app debug unknown 5736 5736 0 0.0
FLASH 5966741 5967621 880 0.0
RAM 601312 601312 0 0.0
tv-casting-app debug unknown 5312 5312 0 0.0
FLASH 11102349 11103229 880 0.0
RAM 700496 700496 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 917804 917964 160 0.0
RAM 143172 143172 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 890868 891020 152 0.0
RAM 141359 141359 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 851932 851968 36 0.0
RAM 142084 142084 0 0.0
nxp contact k32w0+release FLASH 585968 586000 32 0.0
RAM 70952 70952 0 0.0
mcxw71+release FLASH 601488 601520 32 0.0
RAM 63168 63168 0 0.0
light k32w0+release FLASH 612588 612636 48 0.0
RAM 70344 70344 0 0.0
k32w1+release FLASH 687152 687184 32 0.0
RAM 48760 48760 0 0.0
lock mcxw71+release FLASH 763464 763496 32 0.0
RAM 70796 70796 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1652124 1652364 240 0.0
RAM 211632 211632 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1557884 1557996 112 0.0
RAM 208448 208448 0 0.0
light cy8ckit_062s2_43012 FLASH 1472492 1472588 96 0.0
RAM 200416 200416 0 0.0
lock cy8ckit_062s2_43012 FLASH 1470276 1470388 112 0.0
RAM 224768 224768 0 0.0
qpg lighting-app qpg6105+debug FLASH 664144 664176 32 0.0
RAM 105296 105296 0 0.0
lock-app qpg6105+debug FLASH 622004 622036 32 0.0
RAM 99748 99748 0 0.0
stm32 light STM32WB5MM-DK FLASH 484976 485016 40 0.0
RAM 144752 144752 0 0.0
telink bridge-app tlsr9258a FLASH 683552 683598 46 0.0
RAM 91088 91088 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 623810 623856 46 0.0
RAM 31488 31488 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 772652 772698 46 0.0
RAM 49348 49348 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 777256 777302 46 0.0
RAM 99652 99652 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 711250 711296 46 0.0
RAM 73384 73384 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 628264 628310 46 0.0
RAM 142020 142020 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 814266 814312 46 0.0
RAM 99564 99564 0 0.0

@vivien-apple vivien-apple force-pushed the ChipTool_DCL branch 3 times, most recently from 97b9d03 to 035ef81 Compare January 16, 2025 12:51
@vivien-apple vivien-apple changed the title [chip-tool] Add Enhanced Commissioning Support (T&C Flow via Local DCL) to chip-tool [chip-tool] Add Enhanced Commissioning Support (T&C Flow via Local DCL) to chip-tool [changing-submodules-on-purpose] Jan 16, 2025
@vivien-apple vivien-apple changed the title [chip-tool] Add Enhanced Commissioning Support (T&C Flow via Local DCL) to chip-tool [changing-submodules-on-purpose] [chip-tool] Add Enhanced Commissioning Support (T&C Flow via Local DCL) to chip-tool Jan 16, 2025
@vivien-apple vivien-apple added the changing-submodules-on-purpose Marker that this PR is changing submodules (and it is not a "commit all" typo/mistake) label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app changing-submodules-on-purpose Marker that this PR is changing submodules (and it is not a "commit all" typo/mistake) examples linux platform review - pending tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant