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

Include VID/PID in ECM commissioning Setup Payload #11894

Merged

Conversation

pan-apple
Copy link
Contributor

Problem

Change overview

Include VID and PID in the generated Setup Payload when commissioning window is opened using ECM mode.

  • Read VID and PID attributes from the basic cluster, before opening the commissioning window.
  • Include these two values in the generated Setup Payload

Testing

Tested using all-cluster-app and chip-tool

  1. Open the commissioning window using ECM mode.
  2. Parse the generated QR code using chip-tool payload parse-setup-payload command. Check that VID and PID are part of the code.

@pan-apple
Copy link
Contributor Author

@msandstedt, @jelderton, @andy31415 any review feedback?

Copy link
Contributor

@tcarmelveilleux tcarmelveilleux left a comment

Choose a reason for hiding this comment

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

This change pushes into the core communication primitives a lot of policy/choices that should be the responsibility the of client/administrator.

Changes requested:

  • Move generation of setup payload from passcode/vid/pid to the client (e.g. chip-tool as an example), since there should be one way to do it from passcode/discriminator/vid/pid in the SDK, not one for initial commissioning examples and one for commissioning window opening/
  • Do not force the reading of the VID/PID every time from basic info cluster, but rather let the caller application determine if it's needed (since many/most will actually already know VID/PID at time of openign a window). You can take the code and move it to chip tool command of open commissioning Window, to show how an application could do it if it needed.

@stale
Copy link

stale bot commented Nov 26, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale Stale issue or PR label Nov 26, 2021
@woody-apple
Copy link
Contributor

@tcarmelveilleux @pan-apple what are the next steps here? This is part of the spec that we should implement in the SDK.

@stale stale bot removed the stale Stale issue or PR label Nov 30, 2021
@pullapprove pullapprove bot requested a review from vijs November 30, 2021 07:11
@pan-apple pan-apple force-pushed the vid-pid-commissioning-window branch from c574fb9 to fccb851 Compare November 30, 2021 18:29
@pan-apple
Copy link
Contributor Author

pan-apple commented Nov 30, 2021

The latest change makes the reading of VID/PID optional. This would let applications control if they don't need the API to read VID/PID (e.g. if it's already known).

This PR is needed for TE7.5, and there's not enough time to implement the suggested changes.
I am hoping that those can be handled in a follow on PR. Filed this issue to track it #12375

@github-actions
Copy link

github-actions bot commented Nov 30, 2021

PR #11894: Size comparison from 46fbb06 to c98a87c

Increases above 0.2%:

platform target config section 46fbb06 c98a87c change % change
linux tv-app debug .rodata 161448 161992 544 0.3
Increases (2 builds for linux)
platform target config section 46fbb06 c98a87c change % change
linux chip-tool debug .rodata 294344 294888 544 0.2
tv-app debug (read only) 1927729 1928257 528 0.0
.rodata 161448 161992 544 0.3
Decreases (2 builds for linux)
platform target config section 46fbb06 c98a87c change % change
linux chip-tool debug (read only) 6136757 6124485 -12272 -0.2
(read/write) 199576 199544 -32 -0.0
.got 4472 4448 -24 -0.5
.text 5452261 5439733 -12528 -0.2
tv-app debug .text 1617842 1617826 -16 -0.0
Full report (38 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 46fbb06 c98a87c change % change
efr32 lighting-app BRD4161A (read only) 763016 763016 0 0.0
(read/write) 120300 120300 0 0.0
.bss 118476 118476 0 0.0
.data 1820 1820 0 0.0
.text 763008 763008 0 0.0
BRD4161A+rpc (read only) 791512 791512 0 0.0
(read/write) 138596 138596 0 0.0
.bss 136676 136676 0 0.0
.data 1920 1920 0 0.0
.text 791504 791504 0 0.0
lock-app BRD4161A (read only) 736896 736896 0 0.0
(read/write) 118004 118004 0 0.0
.bss 116228 116228 0 0.0
.data 1776 1776 0 0.0
.text 736888 736888 0 0.0
window-app BRD4161A (read only) 739984 739984 0 0.0
(read/write) 118436 118436 0 0.0
.bss 116652 116652 0 0.0
.data 1784 1784 0 0.0
.text 739976 739976 0 0.0
esp32 all-clusters-app c3devkit (read only) 836580 836580 0 0.0
(read/write) 1225258 1225258 0 0.0
.dram0.bss 59608 59608 0 0.0
.dram0.data 13988 13988 0 0.0
.flash.rodata 166400 166400 0 0.0
.flash.text 836580 836580 0 0.0
.iram0.text 61390 61390 0 0.0
m5stack (read only) 908587 908587 0 0.0
(read/write) 424484 424484 0 0.0
.dram0.bss 65000 65000 0 0.0
.dram0.data 33960 33960 0 0.0
.flash.rodata 194244 194244 0 0.0
.flash.text 903203 903203 0 0.0
.iram0.text 122943 122943 0 0.0
k32w lighting-app k32w061+se05x+release (read/write) 724356 724356 0 0.0
.bss 78756 78756 0 0.0
.data 1844 1844 0 0.0
.text 637956 637956 0 0.0
lock-app k32w061+debug (read/write) 613348 613348 0 0.0
.bss 69204 69204 0 0.0
.data 1808 1808 0 0.0
.text 536536 536536 0 0.0
shell k32w061+debug (read/write) 679128 679128 0 0.0
.bss 80780 80780 0 0.0
.data 1780 1780 0 0.0
.text 590768 590768 0 0.0
linux all-clusters-app debug (read only) 1779889 1779889 0 0.0
(read/write) 131960 131960 0 0.0
.bss 60688 60688 0 0.0
.data 1040 1040 0 0.0
.data.rel.ro 64928 64928 0 0.0
.dynamic 592 592 0 0.0
.got 4112 4112 0 0.0
.init 27 27 0 0.0
.init_array 576 576 0 0.0
.rodata 139957 139957 0 0.0
.text 1500914 1500914 0 0.0
bridge-app debug+rpc (read only) 1353061 1353061 0 0.0
(read/write) 78400 78400 0 0.0
.bss 42288 42288 0 0.0
.data 1680 1680 0 0.0
.data.rel.ro 29384 29384 0 0.0
.dynamic 592 592 0 0.0
.got 3984 3984 0 0.0
.init 27 27 0 0.0
.init_array 424 424 0 0.0
.rodata 113820 113820 0 0.0
.text 1139125 1139125 0 0.0
chip-tool debug (read only) 6136757 6124485 -12272 -0.2
(read/write) 199576 199544 -32 -0.0
.bss 40640 40640 0 0.0
.data 1008 1008 0 0.0
.data.rel.ro 152336 152336 0 0.0
.dynamic 592 592 0 0.0
.got 4472 4448 -24 -0.5
.init 27 27 0 0.0
.init_array 496 496 0 0.0
.rodata 294344 294888 544 0.2
.text 5452261 5439733 -12528 -0.2
lighting-app debug+rpc (read only) 1633129 1633129 0 0.0
(read/write) 111520 111520 0 0.0
.bss 47984 47984 0 0.0
.data 1232 1232 0 0.0
.data.rel.ro 56976 56976 0 0.0
.dynamic 608 608 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 552 552 0 0.0
.rodata 132305 132305 0 0.0
.text 1363010 1363010 0 0.0
ota-provider-app debug (read only) 1313409 1313409 0 0.0
(read/write) 76856 76856 0 0.0
.bss 44864 44864 0 0.0
.data 912 912 0 0.0
.data.rel.ro 25944 25944 0 0.0
.dynamic 592 592 0 0.0
.got 4048 4048 0 0.0
.init 27 27 0 0.0
.init_array 464 464 0 0.0
.rodata 114960 114960 0 0.0
.text 1098098 1098098 0 0.0
ota-requestor-app debug (read only) 1413425 1413425 0 0.0
(read/write) 80752 80752 0 0.0
.bss 46976 46976 0 0.0
.data 976 976 0 0.0
.data.rel.ro 27640 27640 0 0.0
.dynamic 592 592 0 0.0
.got 4032 4032 0 0.0
.init 27 27 0 0.0
.init_array 488 488 0 0.0
.rodata 126816 126816 0 0.0
.text 1182818 1182818 0 0.0
shell debug (read only) 821761 821761 0 0.0
(read/write) 67288 67288 0 0.0
.bss 23976 23976 0 0.0
.data 224 224 0 0.0
.data.rel.ro 38560 38560 0 0.0
.dynamic 592 592 0 0.0
.got 3560 3560 0 0.0
.init 27 27 0 0.0
.init_array 360 360 0 0.0
.rodata 79218 79218 0 0.0
.text 635858 635858 0 0.0
tv-app debug (read only) 1927729 1928257 528 0.0
(read/write) 321152 321152 0 0.0
.bss 252376 252376 0 0.0
.data 1504 1504 0 0.0
.data.rel.ro 61608 61608 0 0.0
.dynamic 592 592 0 0.0
.got 4424 4424 0 0.0
.init 27 27 0 0.0
.init_array 640 640 0 0.0
.rodata 161448 161992 544 0.3
.text 1617842 1617826 -16 -0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2296160 2296160 0 0.0
.bss 182348 182348 0 0.0
.data 5128 5128 0 0.0
.heap 848968 848968 0 0.0
.text 1258760 1258760 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2281096 2281096 0 0.0
.bss 172956 172956 0 0.0
.data 5488 5488 0 0.0
.heap 858000 858000 0 0.0
.text 1243696 1243696 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2254192 2254192 0 0.0
.bss 171772 171772 0 0.0
.data 5472 5472 0 0.0
.heap 859200 859200 0 0.0
.text 1216792 1216792 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139744 1139744 0 0.0
.bss 11752 11752 0 0.0
.data 4368 4368 0 0.0
.heap 1020328 1020328 0 0.0
.text 103128 103128 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2051232 2051232 0 0.0
.bss 156920 156920 0 0.0
.data 4872 4872 0 0.0
.heap 874656 874656 0 0.0
.text 1013832 1013832 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 876639 876639 0 0.0
bss 113124 113124 0 0.0
rodata 97344 97344 0 0.0
text 590620 590620 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 839087 839087 0 0.0
bss 109476 109476 0 0.0
rodata 88608 88608 0 0.0
text 564788 564788 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 801674 801674 0 0.0
bss 114500 114500 0 0.0
rodata 92604 92604 0 0.0
text 520076 520076 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 847467 847467 0 0.0
bss 110164 110164 0 0.0
rodata 93084 93084 0 0.0
text 568872 568872 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 772738 772738 0 0.0
bss 111572 111572 0 0.0
rodata 88372 88372 0 0.0
text 498420 498420 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 497327 497327 0 0.0
bss 51824 51824 0 0.0
rodata 45780 45780 0 0.0
text 339436 339436 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 853479 853479 0 0.0
bss 110300 110300 0 0.0
rodata 94816 94816 0 0.0
text 572940 572940 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 846559 846559 0 0.0
bss 110176 110176 0 0.0
rodata 92952 92952 0 0.0
text 568000 568000 0 0.0
shell nrf52840dk_nrf52840 (read/write) 779043 779043 0 0.0
bss 109604 109604 0 0.0
rodata 73192 73192 0 0.0
text 521724 521724 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 694058 694058 0 0.0
bss 110588 110588 0 0.0
rodata 67836 67836 0 0.0
text 442332 442332 0 0.0
p6 all-clusters-app default (read/write) 2317928 2317928 0 0.0
.bss 115256 115256 0 0.0
.data 2424 2424 0 0.0
.heap 915664 915664 0 0.0
.text 1276192 1276192 0 0.0
lock-app default (read/write) 2229400 2229400 0 0.0
.bss 101552 101552 0 0.0
.data 2288 2288 0 0.0
.heap 929504 929504 0 0.0
.text 1187664 1187664 0 0.0
qpg lighting-app qpg6100+debug (read only) 496712 496712 0 0.0
(read/write) 114144 114144 0 0.0
.bss 79640 79640 0 0.0
.data 944 944 0 0.0
.text 491392 491392 0 0.0
lock-app qpg6100+debug (read only) 469316 469316 0 0.0
(read/write) 114144 114144 0 0.0
.bss 78552 78552 0 0.0
.data 896 896 0 0.0
.text 463996 463996 0 0.0
persistent-storage-app qpg6100+debug (read only) 108076 108076 0 0.0
(read/write) 114144 114144 0 0.0
.bss 36864 36864 0 0.0
.data 296 296 0 0.0
.text 102756 102756 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 778454 778454 0 0.0
bss 79700 79700 0 0.0
noinit 37160 37160 0 0.0
text 541270 541270 0 0.0

@woody-apple woody-apple dismissed tcarmelveilleux’s stale review December 2, 2021 07:17

Review comments seem addressed, and it's been a couple days.

@woody-apple
Copy link
Contributor

Fast tracking, given this has been been in review for a while and comments seem addressed

@woody-apple woody-apple merged commit 7db5e8a into project-chip:master Dec 2, 2021
@pan-apple pan-apple deleted the vid-pid-commissioning-window branch December 2, 2021 16:14
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.

QR code shown during ECM needs to use the VID and PID of the node
6 participants