Skip to content

[E2E][JF] Implemented JCM mDNS advertisement and OJCW #38994

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 1 commit into
base: master
Choose a base branch
from

Conversation

vijs
Copy link
Collaborator

@vijs vijs commented May 15, 2025

Implemented JCM mDNS advertisement and Open Joint Commissioning Window
Addresses #38544, #39101 & a subset of #38203

Testing

Verified using the below instructions

  • Start jf-admin-app
$ cd ~/connectedhomeip/examples/jf-admin-app/linux
$ gn gen --check out/debug/ --args='chip_device_config_device_vendor_id=65522'
$ ninja -C out/debug
$ cd out/debug
$ rm -rf jfa_b_kvs && touch jfa_b_kvs
$ ./jfa-app --capabilities 0x4 --passcode 110220055 --secured-device-port 5555 --rpc-server-port 33055 --KVS jfa_b_kvs --vendor-id 0xFFF2
  • Start jf-control-app
$ cd ~/connectedhomeip/examples/jf-control-app/out/debug
$ rm -rf jfc_b_storage_directory && mkdir jfc_b_storage_directory
$ ./jfc-app --rpc-server-port 33055 --storage-directory jfc_b_storage_directory --commissioner-vendor-id 0xFFF2
  • Commission jf-admin-app
>>> pairing onnetwork 11 110220055 --anchor true
  • Open Joint Commissioning Window on JF Admin App of Ecosystem B
>>> jcm open-joint-commissioning-window 11 1 400 1000 1261

Check for the following logs on the jf-admin-app side:

>>> [DIS] Advertise commission parameter vendorID=65522 productID=32769 discriminator=1261/04 cm=2 cp=0 jf=14

Copy link

PR #38994: Size comparison from a647c1b to e3237c4

Full report (1 build for stm32)
platform target config section a647c1b e3237c4 change % change
stm32 light STM32WB5MM-DK FLASH 465132 465328 196 0.0
RAM 141488 141608 120 0.1

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 update the testing summary to contain commands tested and observed results. Verified using docs/guides/joint_fabric_guide.md instructions. seems to try to make it conventient to say manually tested.

However the whole intent of our policy is to make it inconvenient to just say "manually tested" to (strongly!) encourage writing automated tests. So in this case:

  • write details on how you tested (generally what app you built, chip-tool or repl commands run and what were the observed results)
  • explain why automated testing is impossible or what the schedule for adding automated tests is

{
return CHIP_ERROR_INVALID_ARGUMENT;
}
requiredSize = snprintf(buffer, bufferLen, "_J%u", static_cast<uint16_t>(subtype.code));
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see this _J bit in the spec. Where is it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

"J" stands for "Joint Fabric" and follows the same convention used in Commissioner Discovery (Section 4.3.3), where the "_" prefix is followed by the first letter of the acronym. Are you okay with this approach, or do you have any suggestions for improvement?

Copy link
Contributor

@bzbarsky-apple bzbarsky-apple May 16, 2025

Choose a reason for hiding this comment

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

The spec lists which subtypes are advertised. It does not list this subtype.

If you think this should be advertised, fix the spec to say so. There are no "conventions" here, and please don't make up things that are not in the spec. The subtypes that are defined as being advertised are in '4.3.1.3. Commissioning Subtypes" in the spec. And note that it's not always "first letter" for the subtype.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, It is missing from the spec. I will review the need for a _J subtype for the Joint Fabric open commissioning window advertisement. The spec does define the JF key on the other hand.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I am not saying the JF TXT bits are not in the spec, just that this _J part isn't.

Copy link
Contributor

Choose a reason for hiding this comment

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

@bzbarsky-apple Agreed. @vijs I do not understand why we need _J? I believe the JF key is sufficient to meet the requirements, implementation and test concerns for JF commissioning. If there reason we need the _J subtype please explain.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Without _J, it's possible that the controller could initiate the Joint Commissioning flow on a device that doesn't support Joint Commissioning, since only service subtypes are filtered according to the current CHIP tool implementation. This can be discussed separately.

To unblock this PR, _J has been removed in the latest commit to align with the latest specification.

Copy link
Contributor

@robertfarnum robertfarnum May 23, 2025

Choose a reason for hiding this comment

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

Upon further research by Doru and I, we believe that the following spec text should be amended in section 4.3.1.7 as follows:

5. The key/value pair CM=3 SHALL indicate that the publisher is currently in Commissioning Mode
and requires use of a dynamically generated Passcode for commissioning corresponding to the
verifier that was passed to the device using the OpenJointCommissioningWindow command.

@vijs Please confirm above, I will update the spec text accordingly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moving this conversation to #39062 for further discussion.

@@ -47,6 +47,7 @@ static constexpr size_t kKeyDeviceNameMaxLength = 32;
static constexpr size_t kKeyRotatingDeviceIdMaxLength = 100;
static constexpr size_t kKeyPairingInstructionMaxLength = 128;
static constexpr size_t kKeyPairingHintMaxLength = 10;
static constexpr size_t kKeyJointFabricModeMaxLength = 10;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this 10?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It mirrors Pairing Hint - they have the same types and text lengths.

Copy link
Contributor

Choose a reason for hiding this comment

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

No, they do not. Pairing hint has 20 bits defined, which means it can go up to 524288. So technically it should be 6, not 10, but people add new pairing hints every so often...

JF has 4 bits defined and this PR assumes that it will never have more than 8 bits, so the most it can go to in the spec right now is 16, and the most it can go to in this code is 256. There's absolutely no reason for a max length > 3 here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, I changed it to 3 in the latest commit.

@vijs vijs force-pushed the feature/38544 branch from e3237c4 to 7d65b8f Compare May 16, 2025 15:31
@vijs vijs changed the title [E2E][JF] Implemented JCM mDNS advertisement [E2E][JF] Implemented JCM mDNS advertisement and OJCW May 16, 2025
Copy link

github-actions bot commented May 16, 2025

PR #38994: Size comparison from 386263d to 7d65b8f

Increases above 0.2%:

platform target config section 386263d 7d65b8f change % change
nxp contact mcxw71+release RAM 63268 63412 144 0.2
lock mcxw71+release RAM 67692 67836 144 0.2
Full report (54 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 386263d 7d65b8f change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1103246 1103686 440 0.0
RAM 179082 179082 0 0.0
bl702 lighting-app bl702+eth FLASH 656476 656912 436 0.1
RAM 135041 135041 0 0.0
bl702+wifi FLASH 833986 834422 436 0.1
RAM 124597 124597 0 0.0
bl706+mfd+rpc+littlefs FLASH 1066526 1066736 210 0.0
RAM 117429 117589 160 0.1
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 895462 895672 210 0.0
RAM 105732 105892 160 0.2
lighting-app bl702l+mfd+littlefs FLASH 979550 979760 210 0.0
RAM 109932 110092 160 0.1
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 821700 821960 260 0.0
RAM 120296 120432 136 0.1
lock-ftd LP_EM_CC1354P10_6 FLASH 831560 831820 260 0.0
RAM 125448 125584 136 0.1
pump-app LP_EM_CC1354P10_6 FLASH 779120 779412 292 0.0
RAM 113844 113980 136 0.1
pump-controller-app LP_EM_CC1354P10_6 FLASH 763332 763616 284 0.0
RAM 114060 114196 136 0.1
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 549574 550086 512 0.1
RAM 205264 205264 0 0.0
lock CC3235SF_LAUNCHXL FLASH 580982 581502 520 0.1
RAM 205456 205456 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 662829 663141 312 0.0
RAM 77308 77444 136 0.2
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 682681 682993 312 0.0
RAM 79948 80084 136 0.2
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 682681 682993 312 0.0
RAM 79948 80084 136 0.2
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 639613 639933 320 0.1
RAM 72376 72512 136 0.2
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 623981 624309 328 0.1
RAM 73604 73740 136 0.2
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 643609 643945 336 0.1
RAM 76156 76292 136 0.2
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 643609 643945 336 0.1
RAM 76156 76292 136 0.2
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 643325 643661 336 0.1
RAM 76604 76740 136 0.2
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 663041 663369 328 0.0
RAM 79156 79292 136 0.2
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 663041 663369 328 0.0
RAM 79156 79292 136 0.2
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 619505 619825 320 0.1
RAM 70708 70844 136 0.2
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 639357 639669 312 0.0
RAM 73340 73476 136 0.2
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 639357 639669 312 0.0
RAM 73340 73476 136 0.2
efr32 lock-app BRD4187C FLASH 946084 946260 176 0.0
RAM 132096 132224 128 0.1
BRD4338a FLASH 772912 773548 636 0.1
RAM 173320 173320 0 0.0
window-app BRD4187C FLASH 1038736 1039112 376 0.0
RAM 128232 128360 128 0.1
esp32 all-clusters-app c3devkit DRAM 103408 103408 0 0.0
FLASH 1808016 1808514 498 0.0
IRAM 83846 83846 0 0.0
m5stack DRAM 122028 122028 0 0.0
FLASH 1774094 1774678 584 0.0
IRAM 117043 117043 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 921508 921804 296 0.0
RAM 167398 167518 120 0.1
nrf7002dk_nrf5340_cpuapp FLASH 913232 913548 316 0.0
RAM 145642 145642 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 858616 858904 288 0.0
RAM 141161 141281 120 0.1
nxp contact k32w0+release FLASH 592880 593040 160 0.0
RAM 72928 73072 144 0.2
mcxw71+release FLASH 625752 626056 304 0.0
RAM 63268 63412 144 0.2
light k32w0+release FLASH 619020 619196 176 0.0
RAM 72224 72368 144 0.2
k32w1+release FLASH 710480 710768 288 0.0
RAM 72116 72260 144 0.2
lock mcxw71+release FLASH 775560 775864 304 0.0
RAM 67692 67836 144 0.2
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1669172 1669812 640 0.0
RAM 212408 212408 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1573284 1573916 632 0.0
RAM 208592 208592 0 0.0
light cy8ckit_062s2_43012 FLASH 1447468 1448116 648 0.0
RAM 197296 197296 0 0.0
lock cy8ckit_062s2_43012 FLASH 1477364 1477996 632 0.0
RAM 225016 225016 0 0.0
qpg lighting-app qpg6105+debug FLASH 668252 668452 200 0.0
RAM 105244 105380 136 0.1
lock-app qpg6105+debug FLASH 626448 626640 192 0.0
RAM 99872 100008 136 0.1
stm32 light STM32WB5MM-DK FLASH 465940 466120 180 0.0
RAM 141496 141616 120 0.1
telink bridge-app tl7218x FLASH 694572 694736 164 0.0
RAM 101908 102028 120 0.1
light-app-ota-compress-lzma-factory-data tl3218x FLASH 774282 774446 164 0.0
RAM 50060 50180 120 0.2
light-app-ota-shell-factory-data tl7218x FLASH 781388 781548 160 0.0
RAM 109232 109352 120 0.1
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 703534 703698 164 0.0
RAM 62624 62744 120 0.2
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 741488 741648 160 0.0
RAM 85796 85916 120 0.1
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 607710 608038 328 0.1
RAM 119448 119448 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 816698 816866 168 0.0
RAM 107500 107620 120 0.1
tizen all-clusters-app arm unknown 5224 5224 0 0.0
FLASH 1822336 1823348 1012 0.1
RAM 95164 95188 24 0.0
chip-tool-ubsan arm unknown 20600 20632 32 0.2
FLASH 20893358 20907630 14272 0.1
RAM 9083856 9090036 6180 0.1

@doru91
Copy link
Contributor

doru91 commented May 19, 2025

General comment: I would say that this PR implements a subset of #38203 - the OJCW command.

#38203 text also requires handling of some errors paths, so I would advise creating a separate sub-issue (see the "Create sub-issue" button) if those are scheduled for a follow up PR.

What I would like to see in the testing section or added in the docs/guides/joint_fabric.md would be to show that JF=14 is advertised immediately after jf-admin-app is commissioned by jf-control-app.

Copy link
Contributor

@robertfarnum robertfarnum left a comment

Choose a reason for hiding this comment

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

For consistency let's use --jcm true as the flag on the command line for pairing commands.

@vijs vijs force-pushed the feature/38544 branch from 7d65b8f to 4378967 Compare May 19, 2025 19:42
Copy link

github-actions bot commented May 19, 2025

PR #38994: Size comparison from bb6d92f to 4378967

Increases above 0.2%:

platform target config section bb6d92f 4378967 change % change
nxp contact mcxw71+release RAM 63268 63412 144 0.2
lock mcxw71+release RAM 67692 67836 144 0.2
Full report (54 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section bb6d92f 4378967 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1103246 1103686 440 0.0
RAM 179082 179082 0 0.0
bl702 lighting-app bl702+eth FLASH 656476 656912 436 0.1
RAM 135041 135041 0 0.0
bl702+wifi FLASH 833986 834422 436 0.1
RAM 124597 124597 0 0.0
bl706+mfd+rpc+littlefs FLASH 1066526 1066736 210 0.0
RAM 117429 117589 160 0.1
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 895462 895672 210 0.0
RAM 105732 105892 160 0.2
lighting-app bl702l+mfd+littlefs FLASH 979550 979760 210 0.0
RAM 109932 110092 160 0.1
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 821700 821960 260 0.0
RAM 120296 120432 136 0.1
lock-ftd LP_EM_CC1354P10_6 FLASH 831560 831820 260 0.0
RAM 125448 125584 136 0.1
pump-app LP_EM_CC1354P10_6 FLASH 779120 779412 292 0.0
RAM 113844 113980 136 0.1
pump-controller-app LP_EM_CC1354P10_6 FLASH 763332 763616 284 0.0
RAM 114060 114196 136 0.1
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 549574 550086 512 0.1
RAM 205264 205264 0 0.0
lock CC3235SF_LAUNCHXL FLASH 580982 581502 520 0.1
RAM 205456 205456 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 662829 663141 312 0.0
RAM 77308 77444 136 0.2
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 682681 682993 312 0.0
RAM 79948 80084 136 0.2
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 682681 682993 312 0.0
RAM 79948 80084 136 0.2
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 639613 639933 320 0.1
RAM 72376 72512 136 0.2
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 623981 624309 328 0.1
RAM 73604 73740 136 0.2
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 643609 643945 336 0.1
RAM 76156 76292 136 0.2
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 643609 643945 336 0.1
RAM 76156 76292 136 0.2
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 643325 643661 336 0.1
RAM 76604 76740 136 0.2
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 663041 663369 328 0.0
RAM 79156 79292 136 0.2
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 663041 663369 328 0.0
RAM 79156 79292 136 0.2
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 619505 619825 320 0.1
RAM 70708 70844 136 0.2
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 639357 639669 312 0.0
RAM 73340 73476 136 0.2
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 639357 639669 312 0.0
RAM 73340 73476 136 0.2
efr32 lock-app BRD4187C FLASH 946084 946260 176 0.0
RAM 132096 132224 128 0.1
BRD4338a FLASH 772912 773548 636 0.1
RAM 173320 173320 0 0.0
window-app BRD4187C FLASH 1038736 1039112 376 0.0
RAM 128232 128360 128 0.1
esp32 all-clusters-app c3devkit DRAM 103408 103408 0 0.0
FLASH 1809664 1810166 502 0.0
IRAM 83846 83846 0 0.0
m5stack DRAM 122028 122028 0 0.0
FLASH 1775586 1776194 608 0.0
IRAM 117043 117043 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 921508 921804 296 0.0
RAM 167398 167518 120 0.1
nrf7002dk_nrf5340_cpuapp FLASH 913256 913572 316 0.0
RAM 145642 145642 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 858616 858904 288 0.0
RAM 141161 141281 120 0.1
nxp contact k32w0+release FLASH 592880 593040 160 0.0
RAM 72928 73072 144 0.2
mcxw71+release FLASH 625752 626056 304 0.0
RAM 63268 63412 144 0.2
light k32w0+release FLASH 619020 619196 176 0.0
RAM 72224 72368 144 0.2
k32w1+release FLASH 710480 710768 288 0.0
RAM 72116 72260 144 0.2
lock mcxw71+release FLASH 775560 775864 304 0.0
RAM 67692 67836 144 0.2
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1669172 1669812 640 0.0
RAM 212408 212408 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1573284 1573916 632 0.0
RAM 208592 208592 0 0.0
light cy8ckit_062s2_43012 FLASH 1447468 1448116 648 0.0
RAM 197296 197296 0 0.0
lock cy8ckit_062s2_43012 FLASH 1477364 1477996 632 0.0
RAM 225016 225016 0 0.0
qpg lighting-app qpg6105+debug FLASH 668252 668452 200 0.0
RAM 105244 105380 136 0.1
lock-app qpg6105+debug FLASH 626448 626640 192 0.0
RAM 99872 100008 136 0.1
stm32 light STM32WB5MM-DK FLASH 465940 466120 180 0.0
RAM 141496 141616 120 0.1
telink bridge-app tl7218x FLASH 694572 694736 164 0.0
RAM 101908 102028 120 0.1
light-app-ota-compress-lzma-factory-data tl3218x FLASH 774282 774446 164 0.0
RAM 50060 50180 120 0.2
light-app-ota-shell-factory-data tl7218x FLASH 781388 781548 160 0.0
RAM 109232 109352 120 0.1
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 703534 703698 164 0.0
RAM 62624 62744 120 0.2
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 741488 741648 160 0.0
RAM 85796 85916 120 0.1
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 607710 608038 328 0.1
RAM 119448 119448 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 816698 816866 168 0.0
RAM 107500 107620 120 0.1
tizen all-clusters-app arm unknown 5224 5224 0 0.0
FLASH 1822424 1823432 1008 0.1
RAM 95164 95188 24 0.0
chip-tool-ubsan arm unknown 20612 20644 32 0.2
FLASH 20922062 20936302 14240 0.1
RAM 9096248 9102428 6180 0.1

@vijs vijs force-pushed the feature/38544 branch 2 times, most recently from df9e098 to 1e18994 Compare May 21, 2025 10:06
@doru91 doru91 linked an issue May 21, 2025 that may be closed by this pull request
@doru91
Copy link
Contributor

doru91 commented May 21, 2025

General comment: I would say that this PR implements a subset of #38203 - the OJCW command.

#38203 text also requires handling of some errors paths, so I would advise creating a separate sub-issue (see the "Create sub-issue" button) if those are scheduled for a follow up PR.

What I would like to see in the testing section or added in the docs/guides/joint_fabric.md would be to show that JF=14 is advertised immediately after jf-admin-app is commissioned by jf-control-app.

You asked me to review this PR saying that all the comments have been addressed. However, most of the comments haven't been addressed.

@vijs vijs force-pushed the feature/38544 branch from 1e18994 to d38175b Compare May 21, 2025 20:24
Copy link

PR #38994: Size comparison from 08eb175 to d38175b

Full report (2 builds for cc32xx)
platform target config section 08eb175 d38175b change % change
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 549798 550466 668 0.1
RAM 205264 205256 -8 -0.0
lock CC3235SF_LAUNCHXL FLASH 581630 582314 684 0.1
RAM 205448 205440 -8 -0.0

@vijs
Copy link
Collaborator Author

vijs commented May 22, 2025

General comment: I would say that this PR implements a subset of #38203 - the OJCW command.
#38203 text also requires handling of some errors paths, so I would advise creating a separate sub-issue (see the "Create sub-issue" button) if those are scheduled for a follow up PR.
What I would like to see in the testing section or added in the docs/guides/joint_fabric.md would be to show that JF=14 is advertised immediately after jf-admin-app is commissioned by jf-control-app.

You asked me to review this PR saying that all the comments have been addressed. However, most of the comments haven't been addressed.

I've updated the PR description to indicate that it addresses a subset of #38203. A followup PR will address the rest.

@vijs vijs force-pushed the feature/38544 branch 2 times, most recently from 4b7e2bf to 0dae1fb Compare May 22, 2025 17:26
@github-actions github-actions bot added the documentation Improvements or additions to documentation label May 22, 2025
@vijs vijs force-pushed the feature/38544 branch 2 times, most recently from e954be2 to d071c07 Compare May 22, 2025 17:33
Copy link

github-actions bot commented May 22, 2025

PR #38994: Size comparison from 05e766b to d071c07

Full report (4 builds for cc32xx, linux)
platform target config section 05e766b d071c07 change % change
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 548254 548710 456 0.1
RAM 205256 205248 -8 -0.0
lock CC3235SF_LAUNCHXL FLASH 581694 582162 468 0.1
RAM 205448 205440 -8 -0.0
linux chip-tool-ipv6only arm64 unknown 40384 40432 48 0.1
FLASH 12592784 12600784 8000 0.1
RAM 695896 696008 112 0.0
thermostat-no-ble arm64 unknown 9744 9744 0 0.0
FLASH 4226944 4229008 2064 0.0
RAM 232360 232408 48 0.0

@andy31415
Copy link
Contributor

Please update the testing summary to contain commands tested and observed results. Verified using docs/guides/joint_fabric_guide.md instructions. seems to try to make it conventient to say manually tested.

However the whole intent of our policy is to make it inconvenient to just say "manually tested" to (strongly!) encourage writing automated tests. So in this case:

  • write details on how you tested (generally what app you built, chip-tool or repl commands run and what were the observed results)
  • explain why automated testing is impossible or what the schedule for adding automated tests is

@vijs I see you updated the testing section with "look at these lines". Please add details in the testing section and do not reference the MD file. Tell me what you ran and what results you have seen. To be clear: we are intentionally forcing you to write out how you test it and it is inconvenient because this is a "manual test" and we want to discourage that.

And very important: explain why you are manually testing this. Why could you not automate some/all the tests? MDNS currently has tests ... why were not tests added/changed as part of your changes to dnssd code? where are the unit tests for all the other files?

This PR needs unit tests since unit tests are possible at least in a subset of files.

@@ -91,6 +91,8 @@ static_library("chip-tool-utils") {
"commands/icd/ICDCommand.h",
"commands/pairing/OpenCommissioningWindowCommand.cpp",
"commands/pairing/OpenCommissioningWindowCommand.h",
"commands/pairing/OpenJointCommissioningWindowCommand.cpp",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be excluded from the build when Joint Fabric is not wanted?

Copy link
Contributor

Choose a reason for hiding this comment

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

This should be excluded from the build in all the cases: it's jf-control-app which is being used for JF and this allows us to keep chip-tool files untouched.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This has been excluded from chip-tool in the latest commit.

Copy link
Contributor

Choose a reason for hiding this comment

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

I confirm, @robertfarnum please resolve this conversation.

Check for the following logs on the jf-admin-app side:

```
>>> [DIS] Advertise commission parameter vendorID=65521 productID=32769 discriminator=1261/04 cm=2 cp=0 jf=14
Copy link
Contributor

Choose a reason for hiding this comment

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

jf-admin-app from Ecosystem B has 0xFFF2 Vendor ID (see the instructions where it has been commissioned using --commissioner-vendor-id 0xFFF2). Why does it advertise a vendorID of 65521 (0XFFF1)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

--commissioner-vendor-id only sets the vendor ID of the commissioner, not the device. To set the vendor ID on the device side, you need to add --vendor-id to the command that launches the jfb-admin-app.

Copy link
Contributor

@doru91 doru91 May 26, 2025

Choose a reason for hiding this comment

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

I understand, makes sense. In this case please use --vendor-id 0xFFF1 as parameter for jf-admin-app on Ecosystem 1 and --vendor-id 0xFFF2 as parameter for jf-admin-app on Ecosystem 2 - instructions have to be updated accordingly.

The --commissioner-vendor-id and --vendor-id must be identical for the jf-control-app and jf-admin-app of the same Ecosystem.

@doru91
Copy link
Contributor

doru91 commented May 23, 2025

General comment: I would say that this PR implements a subset of #38203 - the OJCW command.
#38203 text also requires handling of some errors paths, so I would advise creating a separate sub-issue (see the "Create sub-issue" button) if those are scheduled for a follow up PR.
What I would like to see in the testing section or added in the docs/guides/joint_fabric.md would be to show that JF=14 is advertised immediately after jf-admin-app is commissioned by jf-control-app.

You asked me to review this PR saying that all the comments have been addressed. However, most of the comments haven't been addressed.

I've updated the PR description to indicate that it addresses a subset of #38203. A followup PR will address the rest.

Thanks, please create a sub-issue for #38203 with what remains to be implemented (I guess it's the error path handling).

@@ -272,6 +273,7 @@ void registerCommandsPairing(Commands & commands, CredentialIssuerCommands * cre
// make_unique<CommissionedListCommand>(),
make_unique<StartUdcServerCommand>(credsIssuerConfig),
make_unique<OpenCommissioningWindowCommand>(credsIssuerConfig),
make_unique<OpenJointCommissioningWindowCommand>(credsIssuerConfig),
Copy link
Contributor

@doru91 doru91 May 23, 2025

Choose a reason for hiding this comment

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

Main goal of jf-control-app is to avoid changing chip-tool files: what jf-control-app did was to copy inside its own folder the chip-tool files that required specific JF changes. However maybe we don't have to copy the entire Commands.h file and manage somehow to make this specific change directly in the main.cpp of the jf-control-app during command registration.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That was the original implementation, but your earlier review requested this change. To avoid unnecessary back-and-forth, the original approach has been reinstated and is reflected in the latest commit. Let's avoid revisiting this unless there's a strong reason.

Copy link
Contributor

@doru91 doru91 May 26, 2025

Choose a reason for hiding this comment

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

Note that I am investing long hours in reviewing the work from the PR, so naming this a "back-and-forth" process sounds a little bit harsh:

  1. First iteration of this PR: jcm open-joint-commissioning-window. My review: it's more natural to have the open-joint-commissioning-window inside the pairing command (e.g.: pairing open-joint-commissioning-window) because the existing open-commissioning-window follows the same pattern (e.g.: pairing open-commissioning-window command)
  2. Second iteration of this PR: pairing open-joint-commissioning-window. My review: good invocation pattern but this required changes inside a chip-tool file (Commands.h) so I was wondering if there is a way to avoid changing Commands.h while keeping the same invocation pattern. Just to detail my comment above: one option for doing that would be to add an Update function in the Commands.cpp file that can add a new command to an existing cluster command. Then this Update command can be called in main.cpp@jf-control-app around registerCommandsPairing command.
  3. You reverted to the first iteration of this PR while suggesting that my requested changes are triggering unnecessary back-and-forth.

@mergify mergify bot added the conflict label May 23, 2025
@vijs vijs force-pushed the feature/38544 branch from d071c07 to af7cb90 Compare May 23, 2025 14:32
@vijs
Copy link
Collaborator Author

vijs commented May 23, 2025

Please update the testing summary to contain commands tested and observed results. Verified using docs/guides/joint_fabric_guide.md instructions. seems to try to make it conventient to say manually tested.
However the whole intent of our policy is to make it inconvenient to just say "manually tested" to (strongly!) encourage writing automated tests. So in this case:

  • write details on how you tested (generally what app you built, chip-tool or repl commands run and what were the observed results)
  • explain why automated testing is impossible or what the schedule for adding automated tests is

@vijs I see you updated the testing section with "look at these lines". Please add details in the testing section and do not reference the MD file. Tell me what you ran and what results you have seen. To be clear: we are intentionally forcing you to write out how you test it and it is inconvenient because this is a "manual test" and we want to discourage that.

And very important: explain why you are manually testing this. Why could you not automate some/all the tests? MDNS currently has tests ... why were not tests added/changed as part of your changes to dnssd code? where are the unit tests for all the other files?

This PR needs unit tests since unit tests are possible at least in a subset of files.

Added tests as suggested and updated the Testing subsection above with detailed instructions from joint_fabric_guide.md.
Since this involves two different demo applications (jf-controller and jf-admin), it’s a bit complex to automate. We’ll evaluate automation options at a later stage.

&mIteration, "Number of PBKDF iterations to use to derive the verifier. Ignored if 'option' is 0.");
AddArgument("discriminator", 0, 4095, &mDiscriminator, "Discriminator to use for advertising. Ignored if 'option' is 0.");
AddArgument("timeout", 0, UINT16_MAX, &mTimeout, "Time, in seconds, before this command is considered to have timed out.");
AddArgument("endpoint-id", 0, UINT16_MAX, &mEndpointId, "Endpoint the command is targeted at.");
Copy link
Contributor

@doru91 doru91 May 26, 2025

Choose a reason for hiding this comment

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

Can we move the endpoint-id immediately after the node-id? I see this is the convention for other commands (node-id followed by endpoint-id).

- Open Joint Commissioning Window on JF Admin App of Ecosystem B

```
>>> jcm open-joint-commissioning-window 11 400 1000 1261 1
Copy link
Contributor

Choose a reason for hiding this comment

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

node-id (11) must be followed by endpoint-id (1)

@@ -390,6 +391,14 @@ CHIP_ERROR CommissioningWindowManager::OpenEnhancedCommissioningWindow(Seconds32
return err;
}

CHIP_ERROR CommissioningWindowManager::OpenJointCommissioningWindow(Seconds32 commissioningTimeout, uint16_t discriminator,
Copy link
Contributor

Choose a reason for hiding this comment

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

All the JF introduced code in the existing code-SDK files should be guarded by CHIP_DEVICE_CONFIG_ENABLE_JOINT_FABRIC introduced by https://github.com/project-chip/connectedhomeip/pull/38749/files (merged).

auto & failSafeContext = Server::GetInstance().GetFailSafeContext();
auto & commissionMgr = Server::GetInstance().GetCommissioningWindowManager();

VerifyOrExit(fabricInfo != nullptr, status.Emplace(AdministratorCommissioning::StatusCode::kPAKEParameterError));
Copy link
Contributor

@doru91 doru91 May 26, 2025

Choose a reason for hiding this comment

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

AdministratorCommissioning::StatusCode::kPAKEParameterError belongs to the AdministratorCommissioning Cluster and it shouldn't be used by Joint Fabric Adminstrator Cluster. Instead, the XML for Joint Fabric Administrator Cluster must be updated to add this cluster-specific status codes. Same comment for the other AdministratorCommissioning Status codes refereced inside this file. Here is the spec-PR: https://github.com/CHIP-Specifications/connectedhomeip-spec/pull/11699

@vijs vijs force-pushed the feature/38544 branch from af7cb90 to f6cd980 Compare May 27, 2025 19:56
@mergify mergify bot removed the conflict label May 27, 2025
Copy link

github-actions bot commented May 27, 2025

PR #38994: Size comparison from 0157dc6 to f6cd980

Full report (35 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, nrfconnect, psoc6, qpg, stm32)
platform target config section 0157dc6 f6cd980 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1102242 1102238 -4 -0.0
RAM 179114 179106 -8 -0.0
bl702 lighting-app bl702+eth FLASH 655348 655344 -4 -0.0
RAM 135073 135073 0 0.0
bl702+wifi FLASH 832858 832854 -4 -0.0
RAM 124637 124621 -16 -0.0
bl706+mfd+rpc+littlefs FLASH 1065398 1065394 -4 -0.0
RAM 117461 117445 -16 -0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 894952 894948 -4 -0.0
RAM 105772 105772 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 978678 978674 -4 -0.0
RAM 109956 109940 -16 -0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 820588 820564 -24 -0.0
RAM 120288 120280 -8 -0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 832176 832168 -8 -0.0
RAM 125440 125432 -8 -0.0
pump-app LP_EM_CC1354P10_6 FLASH 777680 777672 -8 -0.0
RAM 113844 113836 -8 -0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 761996 761988 -8 -0.0
RAM 114052 114044 -8 -0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 548254 548246 -8 -0.0
RAM 205256 205248 -8 -0.0
lock CC3235SF_LAUNCHXL FLASH 581694 581686 -8 -0.0
RAM 205448 205440 -8 -0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 662253 662253 0 0.0
RAM 77472 77464 -8 -0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 682105 682097 -8 -0.0
RAM 80112 80104 -8 -0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 682105 682097 -8 -0.0
RAM 80112 80104 -8 -0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 639045 639037 -8 -0.0
RAM 72540 72532 -8 -0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 623645 623637 -8 -0.0
RAM 73784 73776 -8 -0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 643281 643273 -8 -0.0
RAM 76336 76328 -8 -0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 643281 643273 -8 -0.0
RAM 76336 76328 -8 -0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 644573 644565 -8 -0.0
RAM 76784 76776 -8 -0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 664281 664273 -8 -0.0
RAM 79336 79328 -8 -0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 664281 664273 -8 -0.0
RAM 79336 79328 -8 -0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 619241 619233 -8 -0.0
RAM 70896 70888 -8 -0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 639093 639085 -8 -0.0
RAM 73528 73520 -8 -0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 639093 639085 -8 -0.0
RAM 73528 73520 -8 -0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 921748 921740 -8 -0.0
RAM 167532 167524 -8 -0.0
nrf7002dk_nrf5340_cpuapp FLASH 912996 912984 -12 -0.0
RAM 145776 145768 -8 -0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 858948 858940 -8 -0.0
RAM 141159 141151 -8 -0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1670716 1670716 0 0.0
RAM 212528 212520 -8 -0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1575148 1575148 0 0.0
RAM 208576 208568 -8 -0.0
light cy8ckit_062s2_43012 FLASH 1448108 1448108 0 0.0
RAM 197304 197296 -8 -0.0
lock cy8ckit_062s2_43012 FLASH 1480324 1480324 0 0.0
RAM 225016 225008 -8 -0.0
qpg lighting-app qpg6105+debug FLASH 667228 667228 0 0.0
RAM 105244 105236 -8 -0.0
lock-app qpg6105+debug FLASH 627248 627232 -16 -0.0
RAM 99872 99864 -8 -0.0
stm32 light STM32WB5MM-DK FLASH 464964 464960 -4 -0.0
RAM 141488 141480 -8 -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.

[E2E][JF] Do not save mAdministratorFabricIndex in the JF Datastore
5 participants