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 configure-fabric into the pairing module so chip-tool… #11559

Merged

Conversation

vivien-apple
Copy link
Contributor

… can pair multiple times to the same accessory

Problem

chip-tool can not pair using a different fabric id.

This PR adds alpha, beta, gamma identities to chip-tool. Those identities are a fabric id + a listen port in order to let multiple chip-tool processes runs at the same time. a chip-tool identity can be selected with chip-tool pairing configure-fabric alpha

Change overview

  • Add configure-fabric to the pairing module
  • Update chip-tool PersistentStorage.cpp to save the configured fabric and returns a listen port depending on the selected identity by default

Testing

I have tested it on top of #11527 with the following commands:

$ rm /tmp/chip_tool_config.ini
$ ./out/debug/standalone/chip-all-clusters-app
# onto a other shell window
$ ./out/debug/standalone/chip-tool pairing onnetwork 0x12345 20202021
$ ./out/debug/standalone/chip-tool onoff read on-off 0x12345 1
$ ./out/debug/standalone/chip-tool pairing open-commissioning-window 0x12345 0 120 1 3840
$ ./out/debug/standalone/chip-tool onoff report on-off 1 20 1 0x12345 1
# onto an other shell window
$ ./out/debug/standalone/chip-tool pairing configure-fabric beta
$ ./out/debug/standalone/chip-tool pairing onnetwork 0x54321 20202021
$ ./out/debug/standalone/chip-tool onoff read on-off 0x54321 1
$ ./out/debug/standalone/chip-tool onoff on 0x54321 1

@github-actions
Copy link

github-actions bot commented Nov 8, 2021

PR #11559: Size comparison from b717b36 to 9d6da6b

Decreases (1 build for esp32)
platform target config section b717b36 9d6da6b change % change
esp32 all-clusters-app m5stack (read only) 911763 911747 -16 -0.0
.flash.text 911763 911747 -16 -0.0
Full report (30 builds for efr32, esp32, k32w, mbed, nrfconnect, p6, qpg, telink)
platform target config section b717b36 9d6da6b change % change
efr32 lighting-app BRD4161A (read only) 742648 742648 0 0.0
(read/write) 116236 116236 0 0.0
.bss 114452 114452 0 0.0
.data 1784 1784 0 0.0
.text 742640 742640 0 0.0
BRD4161A+rpc (read only) 730184 730184 0 0.0
(read/write) 132860 132860 0 0.0
.bss 130956 130956 0 0.0
.data 1900 1900 0 0.0
.text 730176 730176 0 0.0
lock-app BRD4161A (read only) 721920 721920 0 0.0
(read/write) 114052 114052 0 0.0
.bss 112308 112308 0 0.0
.data 1744 1744 0 0.0
.text 721912 721912 0 0.0
window-app BRD4161A (read only) 722816 722816 0 0.0
(read/write) 114380 114380 0 0.0
.bss 112628 112628 0 0.0
.data 1748 1748 0 0.0
.text 722808 722808 0 0.0
esp32 all-clusters-app c3devkit (read only) 880598 880598 0 0.0
(read/write) 1306448 1306448 0 0.0
.dram0.bss 58400 58400 0 0.0
.dram0.data 16472 16472 0 0.0
.flash.rodata 198336 198336 0 0.0
.flash.text 880598 880598 0 0.0
.iram0.text 57526 57526 0 0.0
m5stack (read only) 911763 911747 -16 -0.0
(read/write) 423768 423768 0 0.0
.dram0.bss 60904 60904 0 0.0
.dram0.data 32108 32108 0 0.0
.flash.rodata 204592 204592 0 0.0
.flash.text 911763 911747 -16 -0.0
.iram0.text 125115 125115 0 0.0
k32w lighting-app k32w061+se05x+release (read/write) 699460 699460 0 0.0
.bss 77976 77976 0 0.0
.data 1912 1912 0 0.0
.text 613772 613772 0 0.0
lock-app k32w061+debug (read/write) 592268 592268 0 0.0
.bss 68508 68508 0 0.0
.data 1880 1880 0 0.0
.text 516080 516080 0 0.0
shell k32w061+debug (read/write) 657940 657940 0 0.0
.bss 79308 79308 0 0.0
.data 1848 1848 0 0.0
.text 570984 570984 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2290768 2290768 0 0.0
.bss 179404 179404 0 0.0
.data 5232 5232 0 0.0
.heap 851808 851808 0 0.0
.text 1253368 1253368 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2270864 2270864 0 0.0
.bss 172460 172460 0 0.0
.data 5584 5584 0 0.0
.heap 858400 858400 0 0.0
.text 1233464 1233464 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2248584 2248584 0 0.0
.bss 171356 171356 0 0.0
.data 5568 5568 0 0.0
.heap 859520 859520 0 0.0
.text 1211184 1211184 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) 2048760 2048760 0 0.0
.bss 156424 156424 0 0.0
.data 4976 4976 0 0.0
.heap 875048 875048 0 0.0
.text 1011360 1011360 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 862067 862067 0 0.0
bss 111444 111444 0 0.0
rodata 96900 96900 0 0.0
text 578096 578096 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 824415 824415 0 0.0
bss 107796 107796 0 0.0
rodata 88080 88080 0 0.0
text 552244 552244 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 787110 787110 0 0.0
bss 112816 112816 0 0.0
rodata 92160 92160 0 0.0
text 507568 507568 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 838775 838775 0 0.0
bss 110476 110476 0 0.0
rodata 93272 93272 0 0.0
text 559580 559580 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 764086 764086 0 0.0
bss 111888 111888 0 0.0
rodata 88576 88576 0 0.0
text 489144 489144 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 497323 497323 0 0.0
bss 51824 51824 0 0.0
rodata 45776 45776 0 0.0
text 339436 339436 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 844867 844867 0 0.0
bss 110616 110616 0 0.0
rodata 94980 94980 0 0.0
text 563740 563740 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 838647 838647 0 0.0
bss 110512 110512 0 0.0
rodata 93272 93272 0 0.0
text 559316 559316 0 0.0
shell nrf52840dk_nrf52840 (read/write) 776375 776375 0 0.0
bss 109264 109264 0 0.0
rodata 72540 72540 0 0.0
text 519972 519972 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 691430 691430 0 0.0
bss 110248 110248 0 0.0
rodata 67184 67184 0 0.0
text 440580 440580 0 0.0
p6 all-clusters-app default (read/write) 2299200 2299200 0 0.0
.bss 111936 111936 0 0.0
.data 2536 2536 0 0.0
.heap 918872 918872 0 0.0
.text 1257464 1257464 0 0.0
lock-app default (read/write) 2211912 2211912 0 0.0
.bss 100744 100744 0 0.0
.data 2408 2408 0 0.0
.heap 930192 930192 0 0.0
.text 1170176 1170176 0 0.0
qpg lighting-app qpg6100+debug (read only) 490588 490588 0 0.0
(read/write) 114140 114140 0 0.0
.bss 51136 51136 0 0.0
.data 1012 1012 0 0.0
.text 485268 485268 0 0.0
lock-app qpg6100+debug (read only) 466928 466928 0 0.0
(read/write) 114144 114144 0 0.0
.bss 50080 50080 0 0.0
.data 968 968 0 0.0
.text 461608 461608 0 0.0
persistent-storage-app qpg6100+debug (read only) 153396 153396 0 0.0
(read/write) 114140 114140 0 0.0
.bss 19600 19600 0 0.0
.data 364 364 0 0.0
.text 148076 148076 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 663678 663678 0 0.0
bss 69256 69256 0 0.0
noinit 33216 33216 0 0.0
text 458558 458558 0 0.0

examples/chip-tool/config/PersistentStorage.h Outdated Show resolved Hide resolved
examples/chip-tool/config/PersistentStorage.h Outdated Show resolved Hide resolved
… can pair multiple times to the same accessory
@github-actions
Copy link

github-actions bot commented Nov 9, 2021

PR #11559: Size comparison from 372dc6a to f35c15c

Increases above 0.2%:

platform target config section 372dc6a f35c15c change % change
linux chip-tool debug .init_array 424 432 8 1.9
Increases (2 builds for linux)
platform target config section 372dc6a f35c15c change % change
linux chip-tool debug (read only) 4927909 4929477 1568 0.0
(read/write) 133856 133896 40 0.0
.data.rel.ro 100856 100888 32 0.0
.init_array 424 432 8 1.9
.rodata 234416 234576 160 0.1
.text 4423013 4424325 1312 0.0
tv-app debug (read only) 1841649 1841713 64 0.0
.text 1541442 1541506 64 0.0
Full report (38 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 372dc6a f35c15c change % change
efr32 lighting-app BRD4161A (read only) 742640 742640 0 0.0
(read/write) 116236 116236 0 0.0
.bss 114452 114452 0 0.0
.data 1784 1784 0 0.0
.text 742632 742632 0 0.0
BRD4161A+rpc (read only) 730184 730184 0 0.0
(read/write) 132860 132860 0 0.0
.bss 130956 130956 0 0.0
.data 1900 1900 0 0.0
.text 730176 730176 0 0.0
lock-app BRD4161A (read only) 721920 721920 0 0.0
(read/write) 114052 114052 0 0.0
.bss 112308 112308 0 0.0
.data 1744 1744 0 0.0
.text 721912 721912 0 0.0
window-app BRD4161A (read only) 722832 722832 0 0.0
(read/write) 114380 114380 0 0.0
.bss 112628 112628 0 0.0
.data 1748 1748 0 0.0
.text 722824 722824 0 0.0
esp32 all-clusters-app c3devkit (read only) 880650 880650 0 0.0
(read/write) 1306456 1306456 0 0.0
.dram0.bss 58400 58400 0 0.0
.dram0.data 16472 16472 0 0.0
.flash.rodata 198344 198344 0 0.0
.flash.text 880650 880650 0 0.0
.iram0.text 57526 57526 0 0.0
m5stack (read only) 911819 911819 0 0.0
(read/write) 423776 423776 0 0.0
.dram0.bss 60904 60904 0 0.0
.dram0.data 32108 32108 0 0.0
.flash.rodata 204600 204600 0 0.0
.flash.text 911819 911819 0 0.0
.iram0.text 125115 125115 0 0.0
k32w lighting-app k32w061+se05x+release (read/write) 699576 699576 0 0.0
.bss 77980 77980 0 0.0
.data 1912 1912 0 0.0
.text 613884 613884 0 0.0
lock-app k32w061+debug (read/write) 592288 592288 0 0.0
.bss 68508 68508 0 0.0
.data 1880 1880 0 0.0
.text 516100 516100 0 0.0
shell k32w061+debug (read/write) 657944 657944 0 0.0
.bss 79308 79308 0 0.0
.data 1848 1848 0 0.0
.text 570988 570988 0 0.0
linux all-clusters-app debug (read only) 1710033 1710033 0 0.0
(read/write) 125888 125888 0 0.0
.bss 57360 57360 0 0.0
.data 1042 1042 0 0.0
.data.rel.ro 62224 62224 0 0.0
.dynamic 592 592 0 0.0
.got 4088 4088 0 0.0
.init 27 27 0 0.0
.init_array 552 552 0 0.0
.rodata 139765 139765 0 0.0
.text 1436946 1436946 0 0.0
bridge-app debug+rpc (read only) 1297685 1297685 0 0.0
(read/write) 76432 76432 0 0.0
.bss 42256 42256 0 0.0
.data 1568 1568 0 0.0
.data.rel.ro 27640 27640 0 0.0
.dynamic 592 592 0 0.0
.got 3952 3952 0 0.0
.init 27 27 0 0.0
.init_array 408 408 0 0.0
.rodata 111540 111540 0 0.0
.text 1090421 1090421 0 0.0
chip-tool debug (read only) 4927909 4929477 1568 0.0
(read/write) 133856 133896 40 0.0
.bss 25328 25328 0 0.0
.data 2256 2256 0 0.0
.data.rel.ro 100856 100888 32 0.0
.dynamic 592 592 0 0.0
.got 4368 4368 0 0.0
.init 27 27 0 0.0
.init_array 424 432 8 1.9
.rodata 234416 234576 160 0.1
.text 4423013 4424325 1312 0.0
lighting-app debug+rpc (read only) 1557361 1557361 0 0.0
(read/write) 109448 109448 0 0.0
.bss 47920 47920 0 0.0
.data 1202 1202 0 0.0
.data.rel.ro 55040 55040 0 0.0
.dynamic 608 608 0 0.0
.got 4112 4112 0 0.0
.init 27 27 0 0.0
.init_array 528 528 0 0.0
.rodata 128977 128977 0 0.0
.text 1294994 1294994 0 0.0
ota-provider-app debug (read only) 1259137 1259137 0 0.0
(read/write) 74696 74696 0 0.0
.bss 44352 44352 0 0.0
.data 752 752 0 0.0
.data.rel.ro 24488 24488 0 0.0
.dynamic 592 592 0 0.0
.got 4016 4016 0 0.0
.init 27 27 0 0.0
.init_array 448 448 0 0.0
.rodata 113216 113216 0 0.0
.text 1049842 1049842 0 0.0
ota-requestor-app debug (read only) 1343697 1343697 0 0.0
(read/write) 78464 78464 0 0.0
.bss 46816 46816 0 0.0
.data 816 816 0 0.0
.data.rel.ro 25752 25752 0 0.0
.dynamic 592 592 0 0.0
.got 3992 3992 0 0.0
.init 27 27 0 0.0
.init_array 472 472 0 0.0
.rodata 124232 124232 0 0.0
.text 1120834 1120834 0 0.0
shell debug (read only) 788233 788233 0 0.0
(read/write) 64808 64808 0 0.0
.bss 23400 23400 0 0.0
.data 242 242 0 0.0
.data.rel.ro 36656 36656 0 0.0
.dynamic 592 592 0 0.0
.got 3528 3528 0 0.0
.init 27 27 0 0.0
.init_array 344 344 0 0.0
.rodata 78191 78191 0 0.0
.text 608770 608770 0 0.0
tv-app debug (read only) 1841649 1841713 64 0.0
(read/write) 407328 407328 0 0.0
.bss 339600 339600 0 0.0
.data 2736 2736 0 0.0
.data.rel.ro 59328 59328 0 0.0
.dynamic 592 592 0 0.0
.got 4408 4408 0 0.0
.init 27 27 0 0.0
.init_array 616 616 0 0.0
.rodata 156456 156456 0 0.0
.text 1541442 1541506 64 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2290768 2290768 0 0.0
.bss 179404 179404 0 0.0
.data 5232 5232 0 0.0
.heap 851808 851808 0 0.0
.text 1253368 1253368 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2270928 2270928 0 0.0
.bss 172460 172460 0 0.0
.data 5584 5584 0 0.0
.heap 858400 858400 0 0.0
.text 1233528 1233528 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2248584 2248584 0 0.0
.bss 171356 171356 0 0.0
.data 5568 5568 0 0.0
.heap 859520 859520 0 0.0
.text 1211184 1211184 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) 2048760 2048760 0 0.0
.bss 156424 156424 0 0.0
.data 4976 4976 0 0.0
.heap 875048 875048 0 0.0
.text 1011360 1011360 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 862071 862071 0 0.0
bss 111444 111444 0 0.0
rodata 96904 96904 0 0.0
text 578100 578100 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 824419 824419 0 0.0
bss 107796 107796 0 0.0
rodata 88084 88084 0 0.0
text 552248 552248 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 787126 787126 0 0.0
bss 112816 112816 0 0.0
rodata 92160 92160 0 0.0
text 507572 507572 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 838795 838795 0 0.0
bss 110476 110476 0 0.0
rodata 93276 93276 0 0.0
text 559584 559584 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 764090 764090 0 0.0
bss 111888 111888 0 0.0
rodata 88580 88580 0 0.0
text 489148 489148 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) 844871 844871 0 0.0
bss 110616 110616 0 0.0
rodata 94984 94984 0 0.0
text 563744 563744 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 838647 838647 0 0.0
bss 110512 110512 0 0.0
rodata 93272 93272 0 0.0
text 559320 559320 0 0.0
shell nrf52840dk_nrf52840 (read/write) 776379 776379 0 0.0
bss 109264 109264 0 0.0
rodata 72544 72544 0 0.0
text 519972 519972 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 691430 691430 0 0.0
bss 110248 110248 0 0.0
rodata 67184 67184 0 0.0
text 440580 440580 0 0.0
p6 all-clusters-app default (read/write) 2299288 2299288 0 0.0
.bss 111936 111936 0 0.0
.data 2536 2536 0 0.0
.heap 918872 918872 0 0.0
.text 1257552 1257552 0 0.0
lock-app default (read/write) 2211928 2211928 0 0.0
.bss 100744 100744 0 0.0
.data 2408 2408 0 0.0
.heap 930192 930192 0 0.0
.text 1170192 1170192 0 0.0
qpg lighting-app qpg6100+debug (read only) 490712 490712 0 0.0
(read/write) 114140 114140 0 0.0
.bss 51136 51136 0 0.0
.data 1012 1012 0 0.0
.text 485392 485392 0 0.0
lock-app qpg6100+debug (read only) 466940 466940 0 0.0
(read/write) 114144 114144 0 0.0
.bss 50080 50080 0 0.0
.data 968 968 0 0.0
.text 461620 461620 0 0.0
persistent-storage-app qpg6100+debug (read only) 153400 153400 0 0.0
(read/write) 114140 114140 0 0.0
.bss 19600 19600 0 0.0
.data 364 364 0 0.0
.text 148080 148080 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 663682 663682 0 0.0
bss 69256 69256 0 0.0
noinit 33216 33216 0 0.0
text 458562 458562 0 0.0

@woody-apple
Copy link
Contributor

Fast tracking, as this adds functionality to the test tool

@woody-apple woody-apple merged commit f45e6dc into project-chip:master Nov 9, 2021
PSONALl pushed a commit to PSONALl/connectedhomeip that referenced this pull request Dec 3, 2021
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.

3 participants