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] Get chip-tool template to generate write commands for struct attributes now that complex types are supported #14593

Merged

Conversation

vivien-apple
Copy link
Contributor

Problem

chip-tool template does not generate write commands for attributes of type struct. Since complex types are not supported there is no reason to not generate those.

Change overview

  • Remove the template bits that prevents write commands to be generated for attribute of type struct
  • Update the generated code.

Testing

I have manually validated that it works with the command:

$ ./out/debug/standalone/chip-tool testcluster write struct-attr '{"a": 1, "b": true, "c": 2, "d":"0001", "e":"", "f":4, "g": 3.2, "h": -3.2}' 0x12345 1

@vivien-apple vivien-apple changed the title Chip tool generate struct write [chip-tool] Get chip-tool template to generate write commands for struct attributes now that complex types are supported Jan 31, 2022
@github-actions
Copy link

github-actions bot commented Jan 31, 2022

PR #14593: Size comparison from 39115b9 to c782f9b

Increases above 0.2%:

platform target config section 39115b9 c782f9b change % change
linux chip-tool debug (read/write) 180232 180776 544 0.3
.data.rel.ro 136928 137456 528 0.4
chip-tool-ipv6only arm64 .data.rel.ro 178032 178568 536 0.3
Increases (2 builds for linux)
platform target config section 39115b9 c782f9b change % change
linux chip-tool debug (read only) 7005157 7013517 8360 0.1
(read/write) 180232 180776 544 0.3
.data.rel.ro 136928 137456 528 0.4
.rodata 403368 403432 64 0.0
.text 6249029 6256101 7072 0.1
chip-tool-ipv6only arm64 (read only) 6960580 6967764 7184 0.1
(read/write) 282561 283137 576 0.2
.data.rel.ro 178032 178568 536 0.3
.got 45056 45096 40 0.1
.rodata 386556 386668 112 0.0
.text 5989156 5994884 5728 0.1
Full report (42 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 39115b9 c782f9b change % change
cyw30739 light cyw930739m2evb_01 (read/write) 575578 575578 0 0.0
.app_xip_area 482800 482800 0 0.0
.bss 75524 75524 0 0.0
.data 596 596 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock-app CYW30739 (read/write) 533606 533606 0 0.0
.app_xip_area 442404 442404 0 0.0
.bss 73988 73988 0 0.0
.data 560 560 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
efr32 lighting-app BRD4161A (read only) 841496 841496 0 0.0
(read/write) 125056 125056 0 0.0
.bss 123160 123160 0 0.0
.data 1892 1892 0 0.0
.text 841488 841488 0 0.0
BRD4161A+rpc (read only) 828872 828872 0 0.0
(read/write) 141712 141712 0 0.0
.bss 139720 139720 0 0.0
.data 1992 1992 0 0.0
.text 828864 828864 0 0.0
window-app BRD4161A (read only) 814108 814108 0 0.0
(read/write) 123684 123684 0 0.0
.bss 121836 121836 0 0.0
.data 1848 1848 0 0.0
.text 814100 814100 0 0.0
esp32 all-clusters-app c3devkit (read only) 932512 932512 0 0.0
(read/write) 1397882 1397882 0 0.0
.dram0.bss 68968 68968 0 0.0
.dram0.data 14268 14268 0 0.0
.flash.rodata 195744 195744 0 0.0
.flash.text 932512 932512 0 0.0
.iram0.text 62056 62056 0 0.0
m5stack (read only) 980495 980495 0 0.0
(read/write) 462248 462248 0 0.0
.dram0.bss 73728 73728 0 0.0
.dram0.data 34024 34024 0 0.0
.flash.rodata 222368 222368 0 0.0
.flash.text 975111 975111 0 0.0
.iram0.text 123399 123399 0 0.0
k32w light k32w061+release (read/write) 660276 660276 0 0.0
.bss 75212 75212 0 0.0
.data 1852 1852 0 0.0
.text 577412 577412 0 0.0
lock k32w061+release (read/write) 661352 661352 0 0.0
.bss 75532 75532 0 0.0
.data 1892 1892 0 0.0
.text 578128 578128 0 0.0
linux all-clusters-app debug (read only) 2289209 2289209 0 0.0
(read/write) 145400 145400 0 0.0
.bss 61696 61696 0 0.0
.data 1200 1200 0 0.0
.data.rel.ro 76824 76824 0 0.0
.dynamic 592 592 0 0.0
.got 4128 4128 0 0.0
.init 27 27 0 0.0
.init_array 912 912 0 0.0
.rodata 202741 202741 0 0.0
.text 1925810 1925810 0 0.0
bridge-app debug+rpc (read only) 1625749 1625749 0 0.0
(read/write) 87808 87808 0 0.0
.bss 43776 43776 0 0.0
.data 1794 1794 0 0.0
.data.rel.ro 37104 37104 0 0.0
.dynamic 592 592 0 0.0
.got 3968 3968 0 0.0
.init 27 27 0 0.0
.init_array 536 536 0 0.0
.rodata 137268 137268 0 0.0
.text 1373653 1373653 0 0.0
chip-tool debug (read only) 7005157 7013517 8360 0.1
(read/write) 180232 180776 544 0.3
.bss 36264 36264 0 0.0
.data 1088 1088 0 0.0
.data.rel.ro 136928 137456 528 0.4
.dynamic 608 608 0 0.0
.got 4736 4736 0 0.0
.init 27 27 0 0.0
.init_array 600 600 0 0.0
.rodata 403368 403432 64 0.0
.text 6249029 6256101 7072 0.1
chip-tool-ipv6only arm64 (read only) 6960580 6967764 7184 0.1
(read/write) 282561 283137 576 0.2
.bss 54593 54593 0 0.0
.data 1128 1128 0 0.0
.data.rel.ro 178032 178568 536 0.3
.dynamic 560 560 0 0.0
.got 45056 45096 40 0.1
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 386556 386668 112 0.0
.text 5989156 5994884 5728 0.1
door-lock-app debug (read only) 1846673 1846673 0 0.0
(read/write) 117720 117720 0 0.0
.bss 49856 49856 0 0.0
.data 962 962 0 0.0
.data.rel.ro 61504 61504 0 0.0
.dynamic 592 592 0 0.0
.got 4104 4104 0 0.0
.init 27 27 0 0.0
.init_array 656 656 0 0.0
.rodata 170524 170524 0 0.0
.text 1528370 1528370 0 0.0
lighting-app debug+rpc (read only) 1946521 1946521 0 0.0
(read/write) 122712 122712 0 0.0
.bss 50808 50808 0 0.0
.data 1392 1392 0 0.0
.data.rel.ro 65024 65024 0 0.0
.dynamic 608 608 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 696 696 0 0.0
.rodata 160305 160305 0 0.0
.text 1632418 1632418 0 0.0
ota-provider-app debug (read only) 1625777 1625777 0 0.0
(read/write) 87456 87456 0 0.0
.bss 48736 48736 0 0.0
.data 1064 1064 0 0.0
.data.rel.ro 32168 32168 0 0.0
.dynamic 608 608 0 0.0
.got 4240 4240 0 0.0
.init 27 27 0 0.0
.init_array 600 600 0 0.0
.rodata 147246 147246 0 0.0
.text 1361426 1361426 0 0.0
ota-requestor-app debug (read only) 1634505 1634505 0 0.0
(read/write) 90504 90504 0 0.0
.bss 50048 50048 0 0.0
.data 1096 1096 0 0.0
.data.rel.ro 34088 34088 0 0.0
.dynamic 592 592 0 0.0
.got 4032 4032 0 0.0
.init 27 27 0 0.0
.init_array 608 608 0 0.0
.rodata 143487 143487 0 0.0
.text 1374994 1374994 0 0.0
shell debug (read only) 2263833 2263833 0 0.0
(read/write) 147176 147176 0 0.0
.bss 69408 69408 0 0.0
.data 768 768 0 0.0
.data.rel.ro 71328 71328 0 0.0
.dynamic 592 592 0 0.0
.got 4160 4160 0 0.0
.init 27 27 0 0.0
.init_array 896 896 0 0.0
.rodata 203506 203506 0 0.0
.text 1905602 1905602 0 0.0
thermostat-no-ble arm64 (read only) 2079596 2079596 0 0.0
(read/write) 148433 148433 0 0.0
.bss 66177 66177 0 0.0
.data 952 952 0 0.0
.data.rel.ro 74200 74200 0 0.0
.dynamic 560 560 0 0.0
.got 4136 4136 0 0.0
.init 24 24 0 0.0
.init_array 336 336 0 0.0
.rodata 130252 130252 0 0.0
.text 1732144 1732144 0 0.0
tv-app debug (read only) 2400681 2400681 0 0.0
(read/write) 317992 317992 0 0.0
.bss 237312 237312 0 0.0
.data 2944 2944 0 0.0
.data.rel.ro 71752 71752 0 0.0
.dynamic 592 592 0 0.0
.got 4520 4520 0 0.0
.init 27 27 0 0.0
.init_array 864 864 0 0.0
.rodata 190932 190932 0 0.0
.text 2039250 2039250 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2382072 2382072 0 0.0
.bss 187884 187884 0 0.0
.data 5288 5288 0 0.0
.text 1344672 1344672 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2336640 2336640 0 0.0
.bss 178160 178160 0 0.0
.data 5568 5568 0 0.0
.text 1299240 1299240 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2300744 2300744 0 0.0
.bss 178040 178040 0 0.0
.data 5544 5544 0 0.0
.text 1263344 1263344 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139712 1139712 0 0.0
.bss 11756 11756 0 0.0
.data 4368 4368 0 0.0
.text 103096 103096 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2291348 2291348 0 0.0
.bss 175316 175316 0 0.0
.data 5368 5368 0 0.0
.text 1253920 1253920 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 978979 978979 0 0.0
bss 118528 118528 0 0.0
rodata 115464 115464 0 0.0
text 667216 667216 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 964555 964555 0 0.0
bss 115572 115572 0 0.0
rodata 106936 106936 0 0.0
text 663660 663660 0 0.0
nrf52840dongle_nrf52840 (read/write) 995063 995063 0 0.0
bss 119700 119700 0 0.0
rodata 114296 114296 0 0.0
text 672608 672608 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 888178 888178 0 0.0
bss 115316 115316 0 0.0
rodata 108740 108740 0 0.0
text 583400 583400 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 911623 911623 0 0.0
bss 116888 116888 0 0.0
rodata 104100 104100 0 0.0
text 613248 613248 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 821670 821670 0 0.0
bss 113704 113704 0 0.0
rodata 97304 97304 0 0.0
text 530212 530212 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 541779 541779 0 0.0
bss 52588 52588 0 0.0
rodata 50048 50048 0 0.0
text 376940 376940 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 914495 914495 0 0.0
bss 116644 116644 0 0.0
rodata 104612 104612 0 0.0
text 615772 615772 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 909671 909671 0 0.0
bss 116652 116652 0 0.0
rodata 103716 103716 0 0.0
text 611820 611820 0 0.0
shell nrf52840dk_nrf52840 (read/write) 798379 798379 0 0.0
bss 109776 109776 0 0.0
rodata 78352 78352 0 0.0
text 533752 533752 0 0.0
p6 all-clusters-app default (read/write) 2442632 2442632 0 0.0
.bss 116028 116028 0 0.0
.data 2576 2576 0 0.0
.text 1400896 1400896 0 0.0
light-app default (read/write) 2338192 2338192 0 0.0
.bss 103348 103348 0 0.0
.data 2400 2400 0 0.0
.text 1296456 1296456 0 0.0
lock-app default (read/write) 2303664 2303664 0 0.0
.bss 103068 103068 0 0.0
.data 2360 2360 0 0.0
.text 1261928 1261928 0 0.0
qpg lighting-app qpg6105+debug (read only) 569652 569652 0 0.0
(read/write) 146940 146940 0 0.0
.bss 87504 87504 0 0.0
.data 1056 1056 0 0.0
.text 564332 564332 0 0.0
lock-app qpg6105+debug (read only) 515760 515760 0 0.0
(read/write) 146940 146940 0 0.0
.bss 86944 86944 0 0.0
.data 992 992 0 0.0
.text 510440 510440 0 0.0
persistent-storage-app qpg6105+debug (read only) 107140 107140 0 0.0
(read/write) 146940 146940 0 0.0
.bss 38504 38504 0 0.0
.data 288 288 0 0.0
.text 101820 101820 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 843346 843346 0 0.0
bss 85552 85552 0 0.0
noinit 37160 37160 0 0.0
text 591218 591218 0 0.0

Copy link
Contributor

@woody-apple woody-apple left a comment

Choose a reason for hiding this comment

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

Fast tracking, given this is adding tests.

@woody-apple woody-apple merged commit 96045d2 into project-chip:master Feb 1, 2022
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.

2 participants