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

[binding] Make binding table an attribute #14874

Merged
merged 2 commits into from
Feb 8, 2022

Conversation

gjc13
Copy link
Contributor

@gjc13 gjc13 commented Feb 8, 2022

Problem

According to the spec the binding table should be an attribute while it's now exposed as commands.

Change overview

  • Update binding cluster template definition
  • Support binding table read & write in bindings.cpp
  • Fix a crash bug when sending a command to a device during the session establishment.

Testing

How was this tested? (at least one bullet point required)

Run and pair two linux all-cluster-app.

chip-tool binding write binding-list '[{"nodeId": 3, "groupId": 0, "endpointId": 1, "clusterId":6}]' 2 1 
chip-tool binding write binding-list '[{"nodeId": 1, "groupId": 0, "endpointId": 1, "clusterId":6}, {"nodeId": 3, "groupId": 0, "endpointId": 1, "clusterId":6}]' 2 1
chip-tool binding read binding-list 2 1

The read result is correct.

Type switch on in node 2 and the command are received in node 1.

chip-tool binding write binding-list '[]' 2 1
chip-tool binding read binding-list 2 1

The read result is correct and the switch command cannot control node 1.

@gjc13 gjc13 force-pushed the binding-attribute branch from 0d225c7 to 205a6df Compare February 8, 2022 09:41
@github-actions
Copy link

github-actions bot commented Feb 8, 2022

PR #14874: Size comparison from 2f785f4 to 205a6df

Increases above 0.2%:

platform target config section 2f785f4 205a6df change % change
linux thermostat-no-ble arm64 .bss 57665 57953 288 0.5
.init_array 328 336 8 2.4
p6 all-clusters-app default .bss 117976 118496 520 0.4
telink lighting-app tlsr9518adk80d (read/write) 865822 869278 3456 0.4
text 607684 610892 3208 0.5
Increases (8 builds for cyw30739, k32w, linux, p6, qpg, telink)
platform target config section 2f785f4 205a6df change % change
cyw30739 light cyw930739m2evb_01 (read/write) 594490 594498 8 0.0
.app_xip_area 500344 500352 8 0.0
ota-requestor cyw930739m2evb_01 (read/write) 576398 576406 8 0.0
.app_xip_area 474492 474500 8 0.0
k32w light k32w061+release (read/write) 678572 678588 16 0.0
.text 594320 594336 16 0.0
linux chip-tool-ipv6only arm64 (read only) 7402804 7407076 4272 0.1
.rodata 399148 399196 48 0.0
.text 6363828 6368324 4496 0.1
thermostat-no-ble arm64 (read only) 2129932 2133900 3968 0.2
(read/write) 140673 141009 336 0.2
.bss 57665 57953 288 0.5
.data.rel.ro 74904 74952 48 0.1
.init_array 328 336 8 2.4
.rodata 131964 132172 208 0.2
.text 1779904 1783568 3664 0.2
p6 all-clusters-app default (read/write) 2463848 2464960 1112 0.0
.bss 117976 118496 520 0.4
.text 1422112 1423224 1112 0.1
qpg lighting-app qpg6105+debug (read only) 585808 585824 16 0.0
.text 580488 580504 16 0.0
telink lighting-app tlsr9518adk80d (read/write) 865822 869278 3456 0.4
bss 88592 88608 16 0.0
text 607684 610892 3208 0.5
Decreases (6 builds for efr32, linux, p6)
platform target config section 2f785f4 205a6df change % change
efr32 lighting-app BRD4161A (read only) 865876 865684 -192 -0.0
.text 865868 865676 -192 -0.0
BRD4161A+rpc (read only) 853332 853140 -192 -0.0
.text 853324 853132 -192 -0.0
window-app BRD4161A (read only) 838080 837888 -192 -0.0
.text 838072 837880 -192 -0.0
linux chip-tool-ipv6only arm64 (read/write) 302401 302321 -80 -0.0
.data.rel.ro 200208 200120 -88 -0.0
p6 light-app default (read/write) 2367296 2367088 -208 -0.0
.text 1325560 1325352 -208 -0.0
lock-app default (read/write) 2332480 2332272 -208 -0.0
.text 1290744 1290536 -208 -0.0
Full report (17 builds for cyw30739, efr32, k32w, linux, p6, qpg, telink)
platform target config section 2f785f4 205a6df change % change
cyw30739 light cyw930739m2evb_01 (read/write) 594490 594498 8 0.0
.app_xip_area 500344 500352 8 0.0
.bss 76868 76868 0 0.0
.data 624 624 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 552390 552390 0 0.0
.app_xip_area 459804 459804 0 0.0
.bss 75340 75340 0 0.0
.data 588 588 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 576398 576406 8 0.0
.app_xip_area 474492 474500 8 0.0
.bss 84332 84332 0 0.0
.data 532 532 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 865876 865684 -192 -0.0
(read/write) 126620 126620 0 0.0
.bss 124696 124696 0 0.0
.data 1924 1924 0 0.0
.text 865868 865676 -192 -0.0
BRD4161A+rpc (read only) 853332 853140 -192 -0.0
(read/write) 143280 143280 0 0.0
.bss 141256 141256 0 0.0
.data 2024 2024 0 0.0
.text 853324 853132 -192 -0.0
window-app BRD4161A (read only) 838080 837888 -192 -0.0
(read/write) 125264 125264 0 0.0
.bss 123384 123384 0 0.0
.data 1880 1880 0 0.0
.text 838072 837880 -192 -0.0
k32w light k32w061+release (read/write) 678572 678588 16 0.0
.bss 76568 76568 0 0.0
.data 1884 1884 0 0.0
.text 594320 594336 16 0.0
lock k32w061+release (read/write) 680488 680488 0 0.0
.bss 76896 76896 0 0.0
.data 1924 1924 0 0.0
.text 595868 595868 0 0.0
linux chip-tool-ipv6only arm64 (read only) 7402804 7407076 4272 0.1
(read/write) 302401 302321 -80 -0.0
.bss 50641 50641 0 0.0
.data 1176 1176 0 0.0
.data.rel.ro 200208 200120 -88 -0.0
.dynamic 560 560 0 0.0
.got 46584 46584 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 399148 399196 48 0.0
.text 6363828 6368324 4496 0.1
thermostat-no-ble arm64 (read only) 2129932 2133900 3968 0.2
(read/write) 140673 141009 336 0.2
.bss 57665 57953 288 0.5
.data 984 984 0 0.0
.data.rel.ro 74904 74952 48 0.1
.dynamic 560 560 0 0.0
.got 4152 4152 0 0.0
.init 24 24 0 0.0
.init_array 328 336 8 2.4
.rodata 131964 132172 208 0.2
.text 1779904 1783568 3664 0.2
p6 all-clusters-app default (read/write) 2463848 2464960 1112 0.0
.bss 117976 118496 520 0.4
.data 2584 2584 0 0.0
.text 1422112 1423224 1112 0.1
light-app default (read/write) 2367296 2367088 -208 -0.0
.bss 107600 107600 0 0.0
.data 2432 2432 0 0.0
.text 1325560 1325352 -208 -0.0
lock-app default (read/write) 2332480 2332272 -208 -0.0
.bss 107304 107304 0 0.0
.data 2392 2392 0 0.0
.text 1290744 1290536 -208 -0.0
qpg lighting-app qpg6105+debug (read only) 585808 585824 16 0.0
(read/write) 146936 146936 0 0.0
.bss 88856 88856 0 0.0
.data 1084 1084 0 0.0
.text 580488 580504 16 0.0
lock-app qpg6105+debug (read only) 531884 531884 0 0.0
(read/write) 146940 146940 0 0.0
.bss 88304 88304 0 0.0
.data 1024 1024 0 0.0
.text 526564 526564 0 0.0
persistent-storage-app qpg6105+debug (read only) 99520 99520 0 0.0
(read/write) 146940 146940 0 0.0
.bss 24004 24004 0 0.0
.data 176 176 0 0.0
.text 94200 94200 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 865822 869278 3456 0.4
bss 88592 88608 16 0.0
noinit 37160 37160 0 0.0
text 607684 610892 3208 0.5

@github-actions
Copy link

github-actions bot commented Feb 8, 2022

PR #14874: Size comparison from 2f785f4 to 66840dd

Increases above 0.2%:

platform target config section 2f785f4 66840dd change % change
esp32 all-clusters-app c3devkit .dram0.bss 69448 69976 528 0.8
.flash.rodata 198528 199056 528 0.3
m5stack .dram0.bss 74592 75112 520 0.7
linux all-clusters-app debug (read only) 2327673 2333449 5776 0.2
(read/write) 140096 140704 608 0.4
.bss 54688 55232 544 1.0
.rodata 205061 205893 832 0.4
.text 1960290 1965138 4848 0.2
shell debug (read only) 2301113 2306873 5760 0.3
(read/write) 141648 142288 640 0.5
.bss 62080 62624 544 0.9
.rodata 205810 206642 832 0.4
.text 1938786 1943618 4832 0.2
thermostat-no-ble arm64 .bss 57665 57953 288 0.5
.init_array 328 336 8 2.4
tv-app debug (read only) 2525897 2548409 22512 0.9
(read/write) 139832 140376 544 0.4
.bss 57280 57568 288 0.5
.data.rel.ro 73368 73608 240 0.3
.rodata 195564 196652 1088 0.6
.text 2156626 2177618 20992 1.0
mbed all-clusters-app CY8CPROTO_062_4343W+release .bss 188356 188884 528 0.3
p6 all-clusters-app default .bss 117976 118496 520 0.4
telink lighting-app tlsr9518adk80d (read/write) 865822 869278 3456 0.4
text 607684 610892 3208 0.5
Increases (28 builds for cyw30739, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 2f785f4 66840dd change % change
cyw30739 light cyw930739m2evb_01 (read/write) 594490 594498 8 0.0
.app_xip_area 500344 500352 8 0.0
ota-requestor cyw930739m2evb_01 (read/write) 576398 576406 8 0.0
.app_xip_area 474492 474500 8 0.0
esp32 all-clusters-app c3devkit (read only) 937984 938466 482 0.1
(read/write) 1401162 1402218 1056 0.1
.dram0.bss 69448 69976 528 0.8
.flash.rodata 198528 199056 528 0.3
.flash.text 937984 938466 482 0.1
m5stack (read only) 986303 986735 432 0.0
(read/write) 466200 467244 1044 0.2
.dram0.bss 74592 75112 520 0.7
.flash.rodata 225440 225964 524 0.2
.flash.text 980919 981351 432 0.0
k32w light k32w061+release (read/write) 678572 678588 16 0.0
.text 594320 594336 16 0.0
linux all-clusters-app debug (read only) 2327673 2333449 5776 0.2
(read/write) 140096 140704 608 0.4
.bss 54688 55232 544 1.0
.data.rel.ro 78536 78600 64 0.1
.rodata 205061 205893 832 0.4
.text 1960290 1965138 4848 0.2
bridge-app debug+rpc (read only) 1704373 1704549 176 0.0
.text 1447621 1447797 176 0.0
chip-tool debug (read only) 7481925 7487941 6016 0.1
.rodata 416437 416469 32 0.0
.text 6663061 6669333 6272 0.1
chip-tool-ipv6only arm64 (read only) 7402804 7407076 4272 0.1
.rodata 399148 399196 48 0.0
.text 6363828 6368324 4496 0.1
door-lock-app debug (read only) 1908777 1908953 176 0.0
.text 1587442 1587618 176 0.0
lighting-app debug+rpc (read only) 2003609 2003785 176 0.0
.text 1686066 1686242 176 0.0
ota-provider-app debug (read only) 1712241 1712321 80 0.0
.text 1442322 1442402 80 0.0
ota-requestor-app debug (read only) 1701673 1701785 112 0.0
.text 1439890 1440002 112 0.0
shell debug (read only) 2301113 2306873 5760 0.3
(read/write) 141648 142288 640 0.5
.bss 62080 62624 544 0.9
.data.rel.ro 73072 73168 96 0.1
.rodata 205810 206642 832 0.4
.text 1938786 1943618 4832 0.2
thermostat-no-ble arm64 (read only) 2129932 2133900 3968 0.2
(read/write) 140673 141009 336 0.2
.bss 57665 57953 288 0.5
.data.rel.ro 74904 74952 48 0.1
.init_array 328 336 8 2.4
.rodata 131964 132172 208 0.2
.text 1779904 1783568 3664 0.2
tv-app debug (read only) 2525897 2548409 22512 0.9
(read/write) 139832 140376 544 0.4
.bss 57280 57568 288 0.5
.data.rel.ro 73368 73608 240 0.3
.rodata 195564 196652 1088 0.6
.text 2156626 2177618 20992 1.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read/write) 2389752 2390656 904 0.0
.bss 188356 188884 528 0.3
.data 5296 5304 8 0.2
.text 1352352 1353256 904 0.1
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 1004835 1004851 16 0.0
text 686484 686496 12 0.0
nrf52840dk_nrf52840+rpc (read/write) 976311 976327 16 0.0
text 671124 671136 12 0.0
nrf52840dongle_nrf52840 (read/write) 1021639 1021655 16 0.0
text 692052 692064 12 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 911494 911510 16 0.0
text 601508 601520 12 0.0
lock-app nrf52840dk_nrf52840 text 632404 632412 8 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 844586 844602 16 0.0
text 548204 548212 8 0.0
pump-app nrf52840dk_nrf52840 (read/write) 939323 939339 16 0.0
text 634648 634656 8 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 934663 934679 16 0.0
text 630680 630692 12 0.0
p6 all-clusters-app default (read/write) 2463848 2464960 1112 0.0
.bss 117976 118496 520 0.4
.text 1422112 1423224 1112 0.1
qpg lighting-app qpg6105+debug (read only) 585808 585824 16 0.0
.text 580488 580504 16 0.0
telink lighting-app tlsr9518adk80d (read/write) 865822 869278 3456 0.4
bss 88592 88608 16 0.0
text 607684 610892 3208 0.5
Decreases (7 builds for efr32, linux, p6)
platform target config section 2f785f4 66840dd change % change
efr32 lighting-app BRD4161A (read only) 865876 865684 -192 -0.0
.text 865868 865676 -192 -0.0
BRD4161A+rpc (read only) 853332 853140 -192 -0.0
.text 853324 853132 -192 -0.0
window-app BRD4161A (read only) 838080 837888 -192 -0.0
.text 838072 837880 -192 -0.0
linux chip-tool debug (read/write) 198072 197976 -96 -0.0
.data.rel.ro 158536 158424 -112 -0.1
chip-tool-ipv6only arm64 (read/write) 302401 302321 -80 -0.0
.data.rel.ro 200208 200120 -88 -0.0
p6 light-app default (read/write) 2367296 2367088 -208 -0.0
.text 1325560 1325352 -208 -0.0
lock-app default (read/write) 2332480 2332272 -208 -0.0
.text 1290744 1290536 -208 -0.0
Full report (43 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 2f785f4 66840dd change % change
cyw30739 light cyw930739m2evb_01 (read/write) 594490 594498 8 0.0
.app_xip_area 500344 500352 8 0.0
.bss 76868 76868 0 0.0
.data 624 624 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 552390 552390 0 0.0
.app_xip_area 459804 459804 0 0.0
.bss 75340 75340 0 0.0
.data 588 588 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 576398 576406 8 0.0
.app_xip_area 474492 474500 8 0.0
.bss 84332 84332 0 0.0
.data 532 532 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 865876 865684 -192 -0.0
(read/write) 126620 126620 0 0.0
.bss 124696 124696 0 0.0
.data 1924 1924 0 0.0
.text 865868 865676 -192 -0.0
BRD4161A+rpc (read only) 853332 853140 -192 -0.0
(read/write) 143280 143280 0 0.0
.bss 141256 141256 0 0.0
.data 2024 2024 0 0.0
.text 853324 853132 -192 -0.0
window-app BRD4161A (read only) 838080 837888 -192 -0.0
(read/write) 125264 125264 0 0.0
.bss 123384 123384 0 0.0
.data 1880 1880 0 0.0
.text 838072 837880 -192 -0.0
esp32 all-clusters-app c3devkit (read only) 937984 938466 482 0.1
(read/write) 1401162 1402218 1056 0.1
.dram0.bss 69448 69976 528 0.8
.dram0.data 14276 14276 0 0.0
.flash.rodata 198528 199056 528 0.3
.flash.text 937984 938466 482 0.1
.iram0.text 62056 62056 0 0.0
m5stack (read only) 986303 986735 432 0.0
(read/write) 466200 467244 1044 0.2
.dram0.bss 74592 75112 520 0.7
.dram0.data 34040 34040 0 0.0
.flash.rodata 225440 225964 524 0.2
.flash.text 980919 981351 432 0.0
.iram0.text 123399 123399 0 0.0
k32w light k32w061+release (read/write) 678572 678588 16 0.0
.bss 76568 76568 0 0.0
.data 1884 1884 0 0.0
.text 594320 594336 16 0.0
lock k32w061+release (read/write) 680488 680488 0 0.0
.bss 76896 76896 0 0.0
.data 1924 1924 0 0.0
.text 595868 595868 0 0.0
linux all-clusters-app debug (read only) 2327673 2333449 5776 0.2
(read/write) 140096 140704 608 0.4
.bss 54688 55232 544 1.0
.data 1200 1200 0 0.0
.data.rel.ro 78536 78600 64 0.1
.dynamic 592 592 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 205061 205893 832 0.4
.text 1960290 1965138 4848 0.2
bridge-app debug+rpc (read only) 1704373 1704549 176 0.0
(read/write) 84328 84328 0 0.0
.bss 39088 39088 0 0.0
.data 1970 1970 0 0.0
.data.rel.ro 38120 38120 0 0.0
.dynamic 592 592 0 0.0
.got 3976 3976 0 0.0
.init 27 27 0 0.0
.init_array 560 560 0 0.0
.rodata 140204 140204 0 0.0
.text 1447621 1447797 176 0.0
chip-tool debug (read only) 7481925 7487941 6016 0.1
(read/write) 198072 197976 -96 -0.0
.bss 32360 32360 0 0.0
.data 1152 1152 0 0.0
.data.rel.ro 158536 158424 -112 -0.1
.dynamic 608 608 0 0.0
.got 4784 4784 0 0.0
.init 27 27 0 0.0
.init_array 616 616 0 0.0
.rodata 416437 416469 32 0.0
.text 6663061 6669333 6272 0.1
chip-tool-ipv6only arm64 (read only) 7402804 7407076 4272 0.1
(read/write) 302401 302321 -80 -0.0
.bss 50641 50641 0 0.0
.data 1176 1176 0 0.0
.data.rel.ro 200208 200120 -88 -0.0
.dynamic 560 560 0 0.0
.got 46584 46584 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 399148 399196 48 0.0
.text 6363828 6368324 4496 0.1
door-lock-app debug (read only) 1908777 1908953 176 0.0
(read/write) 110584 110584 0 0.0
.bss 42096 42096 0 0.0
.data 946 946 0 0.0
.data.rel.ro 62128 62128 0 0.0
.dynamic 592 592 0 0.0
.got 4112 4112 0 0.0
.init 27 27 0 0.0
.init_array 672 672 0 0.0
.rodata 172818 172818 0 0.0
.text 1587442 1587618 176 0.0
lighting-app debug+rpc (read only) 2003609 2003785 176 0.0
(read/write) 115632 115632 0 0.0
.bss 43104 43104 0 0.0
.data 1368 1368 0 0.0
.data.rel.ro 65672 65672 0 0.0
.dynamic 608 608 0 0.0
.got 4144 4144 0 0.0
.init 27 27 0 0.0
.init_array 712 712 0 0.0
.rodata 162897 162897 0 0.0
.text 1686066 1686242 176 0.0
ota-provider-app debug (read only) 1712241 1712321 80 0.0
(read/write) 81368 81368 0 0.0
.bss 41120 41120 0 0.0
.data 1160 1160 0 0.0
.data.rel.ro 33560 33560 0 0.0
.dynamic 608 608 0 0.0
.got 4240 4240 0 0.0
.init 27 27 0 0.0
.init_array 624 624 0 0.0
.rodata 151238 151238 0 0.0
.text 1442322 1442402 80 0.0
ota-requestor-app debug (read only) 1701673 1701785 112 0.0
(read/write) 83320 83320 0 0.0
.bss 42272 42272 0 0.0
.data 1128 1128 0 0.0
.data.rel.ro 34616 34616 0 0.0
.dynamic 592 592 0 0.0
.got 4040 4040 0 0.0
.init 27 27 0 0.0
.init_array 624 624 0 0.0
.rodata 144887 144887 0 0.0
.text 1439890 1440002 112 0.0
shell debug (read only) 2301113 2306873 5760 0.3
(read/write) 141648 142288 640 0.5
.bss 62080 62624 544 0.9
.data 800 800 0 0.0
.data.rel.ro 73072 73168 96 0.1
.dynamic 592 592 0 0.0
.got 4168 4168 0 0.0
.init 27 27 0 0.0
.init_array 904 904 0 0.0
.rodata 205810 206642 832 0.4
.text 1938786 1943618 4832 0.2
thermostat-no-ble arm64 (read only) 2129932 2133900 3968 0.2
(read/write) 140673 141009 336 0.2
.bss 57665 57953 288 0.5
.data 984 984 0 0.0
.data.rel.ro 74904 74952 48 0.1
.dynamic 560 560 0 0.0
.got 4152 4152 0 0.0
.init 24 24 0 0.0
.init_array 328 336 8 2.4
.rodata 131964 132172 208 0.2
.text 1779904 1783568 3664 0.2
tv-app debug (read only) 2525897 2548409 22512 0.9
(read/write) 139832 140376 544 0.4
.bss 57280 57568 288 0.5
.data 3168 3168 0 0.0
.data.rel.ro 73368 73608 240 0.3
.dynamic 592 592 0 0.0
.got 4528 4528 0 0.0
.init 27 27 0 0.0
.init_array 880 880 0 0.0
.rodata 195564 196652 1088 0.6
.text 2156626 2177618 20992 1.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2389752 2390656 904 0.0
.bss 188356 188884 528 0.3
.data 5296 5304 8 0.2
.text 1352352 1353256 904 0.1
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2348920 2348920 0 0.0
.bss 180936 180936 0 0.0
.data 5600 5600 0 0.0
.text 1311520 1311520 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2312840 2312840 0 0.0
.bss 180824 180824 0 0.0
.data 5584 5584 0 0.0
.text 1275440 1275440 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139648 1139648 0 0.0
.bss 11756 11756 0 0.0
.data 4368 4368 0 0.0
.text 103032 103032 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2302812 2302812 0 0.0
.bss 178100 178100 0 0.0
.data 5400 5400 0 0.0
.text 1265384 1265384 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 1004835 1004851 16 0.0
bss 121280 121280 0 0.0
rodata 118128 118128 0 0.0
text 686484 686496 12 0.0
nrf52840dk_nrf52840+rpc (read/write) 976311 976327 16 0.0
bss 117136 117136 0 0.0
rodata 109588 109588 0 0.0
text 671124 671136 12 0.0
nrf52840dongle_nrf52840 (read/write) 1021639 1021655 16 0.0
bss 122644 122644 0 0.0
rodata 117016 117016 0 0.0
text 692052 692064 12 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 911494 911510 16 0.0
bss 117840 117840 0 0.0
rodata 111384 111384 0 0.0
text 601508 601520 12 0.0
lock-app nrf52840dk_nrf52840 (read/write) 937091 937091 0 0.0
bss 119616 119616 0 0.0
rodata 106528 106528 0 0.0
text 632404 632412 8 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 844586 844602 16 0.0
bss 116212 116212 0 0.0
rodata 99700 99700 0 0.0
text 548204 548212 8 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 541747 541747 0 0.0
bss 52588 52588 0 0.0
rodata 50048 50048 0 0.0
text 376920 376920 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 939323 939339 16 0.0
bss 119368 119368 0 0.0
rodata 106712 106712 0 0.0
text 634648 634656 8 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 934663 934679 16 0.0
bss 119372 119372 0 0.0
rodata 106004 106004 0 0.0
text 630680 630692 12 0.0
shell nrf52840dk_nrf52840 (read/write) 803151 803151 0 0.0
bss 111232 111232 0 0.0
rodata 78532 78532 0 0.0
text 535824 535824 0 0.0
p6 all-clusters-app default (read/write) 2463848 2464960 1112 0.0
.bss 117976 118496 520 0.4
.data 2584 2584 0 0.0
.text 1422112 1423224 1112 0.1
light-app default (read/write) 2367296 2367088 -208 -0.0
.bss 107600 107600 0 0.0
.data 2432 2432 0 0.0
.text 1325560 1325352 -208 -0.0
lock-app default (read/write) 2332480 2332272 -208 -0.0
.bss 107304 107304 0 0.0
.data 2392 2392 0 0.0
.text 1290744 1290536 -208 -0.0
qpg lighting-app qpg6105+debug (read only) 585808 585824 16 0.0
(read/write) 146936 146936 0 0.0
.bss 88856 88856 0 0.0
.data 1084 1084 0 0.0
.text 580488 580504 16 0.0
lock-app qpg6105+debug (read only) 531884 531884 0 0.0
(read/write) 146940 146940 0 0.0
.bss 88304 88304 0 0.0
.data 1024 1024 0 0.0
.text 526564 526564 0 0.0
persistent-storage-app qpg6105+debug (read only) 99520 99520 0 0.0
(read/write) 146940 146940 0 0.0
.bss 24004 24004 0 0.0
.data 176 176 0 0.0
.text 94200 94200 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 865822 869278 3456 0.4
bss 88592 88608 16 0.0
noinit 37160 37160 0 0.0
text 607684 610892 3208 0.5

@Damian-Nordic Damian-Nordic merged commit 5834518 into project-chip:master Feb 8, 2022
@@ -37,7 +37,7 @@ class BridgedActionsAttrAccess : public AttributeAccessInterface
// Register for the Bridged Actions cluster on all endpoints.
BridgedActionsAttrAccess() : AttributeAccessInterface(Optional<EndpointId>::Missing(), BridgedActions::Id) {}

CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
Copy link
Contributor

Choose a reason for hiding this comment

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

This change should not have been made. The fabric index was already available as aEncoder.AccessingFabricIndex().

{
// We already have an active connection
mBoundDeviceChangedHandler(&entry, peerDevice, context);
}
else
{
mPendingNotificationMap.AddPendingNotification(i, context);
ReturnErrorOnFailure(EstablishConnection(entry.fabricIndex, entry.nodeId));
if (!peerDevice->IsConnecting())
Copy link
Contributor

Choose a reason for hiding this comment

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

But what if peerDevice is null here? Won't this crash?


CHIP_ERROR BindingTableAccess::ReadBindingTable(FabricIndex fabricIndex, EndpointId endpoint, AttributeValueEncoder & encoder)
{
DeviceLayer::AttributeList<Structs::BindingEntry::Type, EMBER_BINDING_TABLE_SIZE> bindingTable;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why? Why can't we just encode as we go? Why does the whole list need to be built on the stack? It doesn't.

return true;
}
}
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to check for decode failure, no?


ReturnErrorOnFailure(decoder.Decode(newBindingList));

// Add entries currently not in the binding table
Copy link
Contributor

Choose a reason for hiding this comment

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

This is wrong. Per spec, the order here matters, and this is not going to preserve the order of the incoming list...

emberDeleteBinding(bindingIndex);
emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS);
return true;
// Remove entries not in the new binding list
Copy link
Contributor

Choose a reason for hiding this comment

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

Ignoring the ordering for the moment, this will completely fail if I try to overwrite the whole list with an equal length list, no? If EMBER_BINDING_TABLE_SIZE == 16 and we already have 16 bindings and I try to write 16 new ones... we will try to add before we remove and it will just fail.

Comment on lines +20 to +26
<struct name="BindingEntry">
<cluster code="0x001e"/>
<item name="nodeId" type="NODE_ID"/>
<item name="groupId" type="GROUP_ID"/>
<item name="endpointId" type="ENDPOINT_NO" />
<item name="clusterId" type="CLUSTER_ID" />
</struct>
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 know where this came from, but this does not match the spec. The struct has a different name, it's supposed to have a fabric index, it's supposed to have optional fields, etc, etc.

Had this matched the spec, there would have been no need to add that fabric index argument at all, because it would be right in the struct, as required by the spec.

bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this pull request Feb 8, 2022
This reverts commit 5834518.

The PR made an unnecessary API mass change that should be
reverted no matter what.

It also introduces a null-dereference crash.

Apart from that, the new code does not follow the spec in various ways:

1) Incorrect encoding of the binding target structs.
2) Does not preserve order, as the spec requires.
3) Will fail on legal writes of a list that completely replaces an existing
   list if the _sum_ of the lengths does not fit in our storage.
5) Does not do required error-checking on inputs.
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this pull request Feb 9, 2022
This reverts commit 5834518.

The PR made an unnecessary API mass change that should be
reverted no matter what.

It also introduces a null-dereference crash.

Apart from that, the new code does not follow the spec in various ways:

1) Incorrect encoding of the binding target structs.
2) Does not preserve order, as the spec requires.
3) Will fail on legal writes of a list that completely replaces an existing
   list if the _sum_ of the lengths does not fit in our storage.
5) Does not do required error-checking on inputs.
bzbarsky-apple added a commit that referenced this pull request Feb 9, 2022
This reverts commit 5834518.

The PR made an unnecessary API mass change that should be
reverted no matter what.

It also introduces a null-dereference crash.

Apart from that, the new code does not follow the spec in various ways:

1) Incorrect encoding of the binding target structs.
2) Does not preserve order, as the spec requires.
3) Will fail on legal writes of a list that completely replaces an existing
   list if the _sum_ of the lengths does not fit in our storage.
5) Does not do required error-checking on inputs.
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.

5 participants