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

Introduce a type-safe API for single-attribute subscriptions #12758

Merged

Conversation

bzbarsky-apple
Copy link
Contributor

Problem

Our subscription APIs are not very type-safe and can't represent all Matter types.

Change overview

Introduce an API that subscribes to a single attribute that can do both.

Testing

Modified chip-tool command line to use the new API and tested using that.

@github-actions
Copy link

github-actions bot commented Dec 8, 2021

PR #12758: Size comparison from 4584707 to 9c496a2

Increases above 0.2%:

platform target config section 4584707 9c496a2 change % change
linux chip-tool-ipv6only arm64 (read/write) 312337 316849 4512 1.4
.got 48384 52896 4512 9.3
.rodata 342380 363276 20896 6.1
Increases (3 builds for esp32, linux, mbed)
platform target config section 4584707 9c496a2 change % change
esp32 all-clusters-app m5stack (read only) 962527 963251 724 0.1
(read/write) 450860 450892 32 0.0
.flash.rodata 210040 210072 32 0.0
.flash.text 957143 957867 724 0.1
linux chip-tool-ipv6only arm64 (read/write) 312337 316849 4512 1.4
.got 48384 52896 4512 9.3
.rodata 342380 363276 20896 6.1
mbed lighting-app CY8CPROTO_062_4343W+release (read/write) 2305928 2305992 64 0.0
.text 1268528 1268592 64 0.0
Decreases (1 build for linux)
platform target config section 4584707 9c496a2 change % change
linux chip-tool-ipv6only arm64 (read only) 6786028 6757500 -28528 -0.4
.text 5782004 5719044 -62960 -1.1
Full report (32 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 4584707 9c496a2 change % change
efr32 lighting-app BRD4161A (read only) 803988 803988 0 0.0
(read/write) 122980 122980 0 0.0
.bss 121160 121160 0 0.0
.data 1820 1820 0 0.0
.text 803980 803980 0 0.0
BRD4161A+rpc (read only) 791600 791600 0 0.0
(read/write) 139664 139664 0 0.0
.bss 137736 137736 0 0.0
.data 1928 1928 0 0.0
.text 791592 791592 0 0.0
window-app BRD4161A (read only) 780716 780716 0 0.0
(read/write) 121120 121120 0 0.0
.bss 119336 119336 0 0.0
.data 1784 1784 0 0.0
.text 780708 780708 0 0.0
esp32 all-clusters-app c3devkit (read only) 859230 859230 0 0.0
(read/write) 1306602 1306602 0 0.0
.dram0.bss 67632 67632 0 0.0
.dram0.data 14124 14124 0 0.0
.flash.rodata 171816 171816 0 0.0
.flash.text 859230 859230 0 0.0
.iram0.text 62076 62076 0 0.0
m5stack (read only) 962527 963251 724 0.1
(read/write) 450860 450892 32 0.0
.dram0.bss 74984 74984 0 0.0
.dram0.data 34048 34048 0 0.0
.flash.rodata 210040 210072 32 0.0
.flash.text 957143 957867 724 0.1
.iram0.text 123451 123451 0 0.0
k32w lighting-app k32w061+se05x+release (read/write) 724636 724636 0 0.0
.bss 81232 81232 0 0.0
.data 1852 1852 0 0.0
.text 635752 635752 0 0.0
lock-app k32w061+debug (read/write) 615796 615796 0 0.0
.bss 71896 71896 0 0.0
.data 1820 1820 0 0.0
.text 536280 536280 0 0.0
shell k32w061+debug (read/write) 679052 679052 0 0.0
.bss 81596 81596 0 0.0
.data 1792 1792 0 0.0
.text 589864 589864 0 0.0
linux chip-tool-ipv6only arm64 (read only) 6786028 6757500 -28528 -0.4
(read/write) 312337 316849 4512 1.4
.bss 51633 51633 0 0.0
.data 1048 1048 0 0.0
.data.rel.ro 207632 207632 0 0.0
.dynamic 560 560 0 0.0
.got 48384 52896 4512 9.3
.init 24 24 0 0.0
.init_array 160 160 0 0.0
.rodata 342380 363276 20896 6.1
.text 5782004 5719044 -62960 -1.1
thermostat-no-ble arm64 (read only) 1932068 1932068 0 0.0
(read/write) 136321 136321 0 0.0
.bss 59425 59425 0 0.0
.data 776 776 0 0.0
.data.rel.ro 69736 69736 0 0.0
.dynamic 560 560 0 0.0
.got 3520 3520 0 0.0
.init 24 24 0 0.0
.init_array 256 256 0 0.0
.rodata 124820 124820 0 0.0
.text 1601520 1601520 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2320032 2320032 0 0.0
.bss 186884 186884 0 0.0
.data 5232 5232 0 0.0
.heap 844328 844328 0 0.0
.text 1282608 1282608 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2305928 2305992 64 0.0
.bss 175696 175696 0 0.0
.data 5488 5488 0 0.0
.heap 855264 855264 0 0.0
.text 1268528 1268592 64 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2278720 2278720 0 0.0
.bss 174736 174736 0 0.0
.data 5488 5488 0 0.0
.heap 856224 856224 0 0.0
.text 1241320 1241320 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1140008 1140008 0 0.0
.bss 11756 11756 0 0.0
.data 4376 4376 0 0.0
.heap 1020312 1020312 0 0.0
.text 103392 103392 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2047808 2047808 0 0.0
.bss 156564 156564 0 0.0
.data 4864 4864 0 0.0
.heap 875016 875016 0 0.0
.text 1010408 1010408 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 903283 903283 0 0.0
bss 116168 116168 0 0.0
rodata 101164 101164 0 0.0
text 610376 610376 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 866307 866307 0 0.0
bss 112516 112516 0 0.0
rodata 92460 92460 0 0.0
text 585104 585104 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 829274 829274 0 0.0
bss 117544 117544 0 0.0
rodata 96420 96420 0 0.0
text 540804 540804 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 875527 875527 0 0.0
bss 113432 113432 0 0.0
rodata 97280 97280 0 0.0
text 589440 589440 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 801758 801758 0 0.0
bss 114840 114840 0 0.0
rodata 92568 92568 0 0.0
text 519964 519964 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 497463 497463 0 0.0
bss 51820 51820 0 0.0
rodata 45852 45852 0 0.0
text 339492 339492 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 880455 880455 0 0.0
bss 113344 113344 0 0.0
rodata 98632 98632 0 0.0
text 593032 593032 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 873651 873651 0 0.0
bss 113220 113220 0 0.0
rodata 96772 96772 0 0.0
text 588192 588192 0 0.0
shell nrf52840dk_nrf52840 (read/write) 781627 781627 0 0.0
bss 109552 109552 0 0.0
rodata 74280 74280 0 0.0
text 523280 523280 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 696702 696702 0 0.0
bss 110532 110532 0 0.0
rodata 68920 68920 0 0.0
text 443924 443924 0 0.0
p6 all-clusters-app default (read/write) 2356128 2356128 0 0.0
.bss 113116 113116 0 0.0
.data 2512 2512 0 0.0
.heap 917712 917712 0 0.0
.text 1314392 1314392 0 0.0
light-app default (read/write) 2290512 2290512 0 0.0
.bss 100888 100888 0 0.0
.data 2328 2328 0 0.0
.heap 930128 930128 0 0.0
.text 1248776 1248776 0 0.0
lock-app default (read/write) 2266376 2266376 0 0.0
.bss 99768 99768 0 0.0
.data 2288 2288 0 0.0
.heap 931288 931288 0 0.0
.text 1224640 1224640 0 0.0
qpg lighting-app qpg6100+debug (read only) 517944 517944 0 0.0
(read/write) 122332 122332 0 0.0
.bss 82616 82616 0 0.0
.data 956 956 0 0.0
.text 512624 512624 0 0.0
lock-app qpg6100+debug (read only) 491944 491944 0 0.0
(read/write) 122336 122336 0 0.0
.bss 81752 81752 0 0.0
.data 912 912 0 0.0
.text 486624 486624 0 0.0
persistent-storage-app qpg6100+debug (read only) 108104 108104 0 0.0
(read/write) 122336 122336 0 0.0
.bss 36152 36152 0 0.0
.data 288 288 0 0.0
.text 102784 102784 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 807462 807462 0 0.0
bss 82748 82748 0 0.0
noinit 37160 37160 0 0.0
text 563528 563528 0 0.0

@bzbarsky-apple bzbarsky-apple force-pushed the better-single-attr-subscription branch from 9c496a2 to 8b5ee95 Compare December 9, 2021 04:21
@github-actions
Copy link

github-actions bot commented Dec 9, 2021

PR #12758: Size comparison from bba082b to 8b5ee95

Increases above 0.2%:

platform target config section bba082b 8b5ee95 change % change
linux chip-tool-ipv6only arm64 (read/write) 312337 316849 4512 1.4
.got 48384 52896 4512 9.3
.rodata 342396 363292 20896 6.1
Increases (2 builds for esp32, linux)
platform target config section bba082b 8b5ee95 change % change
esp32 all-clusters-app m5stack (read only) 962535 963259 724 0.1
(read/write) 450980 451012 32 0.0
.flash.rodata 210144 210176 32 0.0
.flash.text 957151 957875 724 0.1
linux chip-tool-ipv6only arm64 (read/write) 312337 316849 4512 1.4
.got 48384 52896 4512 9.3
.rodata 342396 363292 20896 6.1
Decreases (1 build for linux)
platform target config section bba082b 8b5ee95 change % change
linux chip-tool-ipv6only arm64 (read only) 6786172 6762412 -23760 -0.4
.text 5782132 5723940 -58192 -1.0
Full report (32 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section bba082b 8b5ee95 change % change
efr32 lighting-app BRD4161A (read only) 804020 804020 0 0.0
(read/write) 122988 122988 0 0.0
.bss 121168 121168 0 0.0
.data 1820 1820 0 0.0
.text 804012 804012 0 0.0
BRD4161A+rpc (read only) 791616 791616 0 0.0
(read/write) 139672 139672 0 0.0
.bss 137744 137744 0 0.0
.data 1928 1928 0 0.0
.text 791608 791608 0 0.0
window-app BRD4161A (read only) 780732 780732 0 0.0
(read/write) 121120 121120 0 0.0
.bss 119336 119336 0 0.0
.data 1784 1784 0 0.0
.text 780724 780724 0 0.0
esp32 all-clusters-app c3devkit (read only) 859206 859206 0 0.0
(read/write) 1306706 1306706 0 0.0
.dram0.bss 67632 67632 0 0.0
.dram0.data 14124 14124 0 0.0
.flash.rodata 171920 171920 0 0.0
.flash.text 859206 859206 0 0.0
.iram0.text 62076 62076 0 0.0
m5stack (read only) 962535 963259 724 0.1
(read/write) 450980 451012 32 0.0
.dram0.bss 75000 75000 0 0.0
.dram0.data 34048 34048 0 0.0
.flash.rodata 210144 210176 32 0.0
.flash.text 957151 957875 724 0.1
.iram0.text 123451 123451 0 0.0
k32w lighting-app k32w061+se05x+release (read/write) 724652 724652 0 0.0
.bss 81232 81232 0 0.0
.data 1852 1852 0 0.0
.text 635768 635768 0 0.0
lock-app k32w061+debug (read/write) 615812 615812 0 0.0
.bss 71896 71896 0 0.0
.data 1820 1820 0 0.0
.text 536296 536296 0 0.0
shell k32w061+debug (read/write) 679068 679068 0 0.0
.bss 81596 81596 0 0.0
.data 1792 1792 0 0.0
.text 589880 589880 0 0.0
linux chip-tool-ipv6only arm64 (read only) 6786172 6762412 -23760 -0.4
(read/write) 312337 316849 4512 1.4
.bss 51633 51633 0 0.0
.data 1048 1048 0 0.0
.data.rel.ro 207632 207632 0 0.0
.dynamic 560 560 0 0.0
.got 48384 52896 4512 9.3
.init 24 24 0 0.0
.init_array 160 160 0 0.0
.rodata 342396 363292 20896 6.1
.text 5782132 5723940 -58192 -1.0
thermostat-no-ble arm64 (read only) 1931988 1931988 0 0.0
(read/write) 136337 136337 0 0.0
.bss 59441 59441 0 0.0
.data 776 776 0 0.0
.data.rel.ro 69736 69736 0 0.0
.dynamic 560 560 0 0.0
.got 3520 3520 0 0.0
.init 24 24 0 0.0
.init_array 256 256 0 0.0
.rodata 124820 124820 0 0.0
.text 1601440 1601440 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2320200 2320200 0 0.0
.bss 186884 186884 0 0.0
.data 5232 5232 0 0.0
.heap 844328 844328 0 0.0
.text 1282776 1282776 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2305992 2305992 0 0.0
.bss 175696 175696 0 0.0
.data 5488 5488 0 0.0
.heap 855264 855264 0 0.0
.text 1268592 1268592 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2278720 2278720 0 0.0
.bss 174736 174736 0 0.0
.data 5488 5488 0 0.0
.heap 856224 856224 0 0.0
.text 1241320 1241320 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1140008 1140008 0 0.0
.bss 11756 11756 0 0.0
.data 4376 4376 0 0.0
.heap 1020312 1020312 0 0.0
.text 103392 103392 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2047808 2047808 0 0.0
.bss 156564 156564 0 0.0
.data 4864 4864 0 0.0
.heap 875016 875016 0 0.0
.text 1010408 1010408 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 903299 903299 0 0.0
bss 116168 116168 0 0.0
rodata 101164 101164 0 0.0
text 610392 610392 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 866323 866323 0 0.0
bss 112516 112516 0 0.0
rodata 92460 92460 0 0.0
text 585120 585120 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 829290 829290 0 0.0
bss 117544 117544 0 0.0
rodata 96420 96420 0 0.0
text 540820 540820 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 875527 875527 0 0.0
bss 113432 113432 0 0.0
rodata 97280 97280 0 0.0
text 589452 589452 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 801774 801774 0 0.0
bss 114840 114840 0 0.0
rodata 92568 92568 0 0.0
text 519976 519976 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 497463 497463 0 0.0
bss 51820 51820 0 0.0
rodata 45852 45852 0 0.0
text 339492 339492 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 880455 880455 0 0.0
bss 113344 113344 0 0.0
rodata 98632 98632 0 0.0
text 593044 593044 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 873667 873667 0 0.0
bss 113220 113220 0 0.0
rodata 96772 96772 0 0.0
text 588204 588204 0 0.0
shell nrf52840dk_nrf52840 (read/write) 781627 781627 0 0.0
bss 109552 109552 0 0.0
rodata 74280 74280 0 0.0
text 523280 523280 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 696702 696702 0 0.0
bss 110532 110532 0 0.0
rodata 68920 68920 0 0.0
text 443924 443924 0 0.0
p6 all-clusters-app default (read/write) 2356232 2356232 0 0.0
.bss 113116 113116 0 0.0
.data 2512 2512 0 0.0
.heap 917712 917712 0 0.0
.text 1314496 1314496 0 0.0
light-app default (read/write) 2290528 2290528 0 0.0
.bss 100888 100888 0 0.0
.data 2328 2328 0 0.0
.heap 930128 930128 0 0.0
.text 1248792 1248792 0 0.0
lock-app default (read/write) 2266392 2266392 0 0.0
.bss 99768 99768 0 0.0
.data 2288 2288 0 0.0
.heap 931288 931288 0 0.0
.text 1224656 1224656 0 0.0
qpg lighting-app qpg6100+debug (read only) 517960 517960 0 0.0
(read/write) 122332 122332 0 0.0
.bss 82616 82616 0 0.0
.data 956 956 0 0.0
.text 512640 512640 0 0.0
lock-app qpg6100+debug (read only) 491960 491960 0 0.0
(read/write) 122336 122336 0 0.0
.bss 81752 81752 0 0.0
.data 912 912 0 0.0
.text 486640 486640 0 0.0
persistent-storage-app qpg6100+debug (read only) 108104 108104 0 0.0
(read/write) 122336 122336 0 0.0
.bss 36152 36152 0 0.0
.data 288 288 0 0.0
.text 102784 102784 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 807478 807478 0 0.0
bss 82748 82748 0 0.0
noinit 37160 37160 0 0.0
text 563540 563540 0 0.0

@bzbarsky-apple
Copy link
Contributor Author

/rebase

@woody-apple woody-apple force-pushed the better-single-attr-subscription branch from 8b5ee95 to c480263 Compare December 9, 2021 06:51
@github-actions
Copy link

github-actions bot commented Dec 9, 2021

PR #12758: Size comparison from 6ea2c90 to c480263

Increases above 0.2%:

platform target config section 6ea2c90 c480263 change % change
linux chip-tool-ipv6only arm64 (read/write) 312337 316849 4512 1.4
.got 48384 52896 4512 9.3
.rodata 342396 363292 20896 6.1
Increases (2 builds for esp32, linux)
platform target config section 6ea2c90 c480263 change % change
esp32 all-clusters-app m5stack (read only) 962535 963259 724 0.1
(read/write) 450980 451012 32 0.0
.flash.rodata 210144 210176 32 0.0
.flash.text 957151 957875 724 0.1
linux chip-tool-ipv6only arm64 (read/write) 312337 316849 4512 1.4
.got 48384 52896 4512 9.3
.rodata 342396 363292 20896 6.1
Decreases (1 build for linux)
platform target config section 6ea2c90 c480263 change % change
linux chip-tool-ipv6only arm64 (read only) 6786172 6762412 -23760 -0.4
.text 5782132 5723940 -58192 -1.0
Full report (32 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 6ea2c90 c480263 change % change
efr32 lighting-app BRD4161A (read only) 804092 804092 0 0.0
(read/write) 122988 122988 0 0.0
.bss 121168 121168 0 0.0
.data 1820 1820 0 0.0
.text 804084 804084 0 0.0
BRD4161A+rpc (read only) 791696 791696 0 0.0
(read/write) 139672 139672 0 0.0
.bss 137744 137744 0 0.0
.data 1928 1928 0 0.0
.text 791688 791688 0 0.0
window-app BRD4161A (read only) 780804 780804 0 0.0
(read/write) 121120 121120 0 0.0
.bss 119336 119336 0 0.0
.data 1784 1784 0 0.0
.text 780796 780796 0 0.0
esp32 all-clusters-app c3devkit (read only) 859206 859206 0 0.0
(read/write) 1306706 1306706 0 0.0
.dram0.bss 67632 67632 0 0.0
.dram0.data 14124 14124 0 0.0
.flash.rodata 171920 171920 0 0.0
.flash.text 859206 859206 0 0.0
.iram0.text 62076 62076 0 0.0
m5stack (read only) 962535 963259 724 0.1
(read/write) 450980 451012 32 0.0
.dram0.bss 75000 75000 0 0.0
.dram0.data 34048 34048 0 0.0
.flash.rodata 210144 210176 32 0.0
.flash.text 957151 957875 724 0.1
.iram0.text 123451 123451 0 0.0
k32w lighting-app k32w061+se05x+release (read/write) 724652 724652 0 0.0
.bss 81232 81232 0 0.0
.data 1852 1852 0 0.0
.text 635768 635768 0 0.0
lock-app k32w061+debug (read/write) 615812 615812 0 0.0
.bss 71896 71896 0 0.0
.data 1820 1820 0 0.0
.text 536296 536296 0 0.0
shell k32w061+debug (read/write) 679068 679068 0 0.0
.bss 81596 81596 0 0.0
.data 1792 1792 0 0.0
.text 589880 589880 0 0.0
linux chip-tool-ipv6only arm64 (read only) 6786172 6762412 -23760 -0.4
(read/write) 312337 316849 4512 1.4
.bss 51633 51633 0 0.0
.data 1048 1048 0 0.0
.data.rel.ro 207632 207632 0 0.0
.dynamic 560 560 0 0.0
.got 48384 52896 4512 9.3
.init 24 24 0 0.0
.init_array 160 160 0 0.0
.rodata 342396 363292 20896 6.1
.text 5782132 5723940 -58192 -1.0
thermostat-no-ble arm64 (read only) 1931988 1931988 0 0.0
(read/write) 136337 136337 0 0.0
.bss 59441 59441 0 0.0
.data 776 776 0 0.0
.data.rel.ro 69736 69736 0 0.0
.dynamic 560 560 0 0.0
.got 3520 3520 0 0.0
.init 24 24 0 0.0
.init_array 256 256 0 0.0
.rodata 124820 124820 0 0.0
.text 1601440 1601440 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2320200 2320200 0 0.0
.bss 186884 186884 0 0.0
.data 5232 5232 0 0.0
.heap 844328 844328 0 0.0
.text 1282776 1282776 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2305992 2305992 0 0.0
.bss 175696 175696 0 0.0
.data 5488 5488 0 0.0
.heap 855264 855264 0 0.0
.text 1268592 1268592 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2278720 2278720 0 0.0
.bss 174736 174736 0 0.0
.data 5488 5488 0 0.0
.heap 856224 856224 0 0.0
.text 1241320 1241320 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1140008 1140008 0 0.0
.bss 11756 11756 0 0.0
.data 4376 4376 0 0.0
.heap 1020312 1020312 0 0.0
.text 103392 103392 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2047808 2047808 0 0.0
.bss 156564 156564 0 0.0
.data 4864 4864 0 0.0
.heap 875016 875016 0 0.0
.text 1010408 1010408 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 903299 903299 0 0.0
bss 116168 116168 0 0.0
rodata 101164 101164 0 0.0
text 610392 610392 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 866323 866323 0 0.0
bss 112516 112516 0 0.0
rodata 92460 92460 0 0.0
text 585120 585120 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 829290 829290 0 0.0
bss 117544 117544 0 0.0
rodata 96420 96420 0 0.0
text 540820 540820 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 875527 875527 0 0.0
bss 113432 113432 0 0.0
rodata 97280 97280 0 0.0
text 589452 589452 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 801774 801774 0 0.0
bss 114840 114840 0 0.0
rodata 92568 92568 0 0.0
text 519976 519976 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 497463 497463 0 0.0
bss 51820 51820 0 0.0
rodata 45852 45852 0 0.0
text 339492 339492 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 880455 880455 0 0.0
bss 113344 113344 0 0.0
rodata 98632 98632 0 0.0
text 593044 593044 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 873667 873667 0 0.0
bss 113220 113220 0 0.0
rodata 96772 96772 0 0.0
text 588204 588204 0 0.0
shell nrf52840dk_nrf52840 (read/write) 781627 781627 0 0.0
bss 109552 109552 0 0.0
rodata 74280 74280 0 0.0
text 523280 523280 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 696702 696702 0 0.0
bss 110532 110532 0 0.0
rodata 68920 68920 0 0.0
text 443924 443924 0 0.0
p6 all-clusters-app default (read/write) 2356232 2356232 0 0.0
.bss 113116 113116 0 0.0
.data 2512 2512 0 0.0
.heap 917712 917712 0 0.0
.text 1314496 1314496 0 0.0
light-app default (read/write) 2290528 2290528 0 0.0
.bss 100888 100888 0 0.0
.data 2328 2328 0 0.0
.heap 930128 930128 0 0.0
.text 1248792 1248792 0 0.0
lock-app default (read/write) 2266392 2266392 0 0.0
.bss 99768 99768 0 0.0
.data 2288 2288 0 0.0
.heap 931288 931288 0 0.0
.text 1224656 1224656 0 0.0
qpg lighting-app qpg6100+debug (read only) 517960 517960 0 0.0
(read/write) 122332 122332 0 0.0
.bss 82616 82616 0 0.0
.data 956 956 0 0.0
.text 512640 512640 0 0.0
lock-app qpg6100+debug (read only) 491960 491960 0 0.0
(read/write) 122336 122336 0 0.0
.bss 81752 81752 0 0.0
.data 912 912 0 0.0
.text 486640 486640 0 0.0
persistent-storage-app qpg6100+debug (read only) 108104 108104 0 0.0
(read/write) 122336 122336 0 0.0
.bss 36152 36152 0 0.0
.data 288 288 0 0.0
.text 102784 102784 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 807478 807478 0 0.0
bss 82748 82748 0 0.0
noinit 37160 37160 0 0.0
text 563540 563540 0 0.0

@bzbarsky-apple bzbarsky-apple linked an issue Dec 9, 2021 that may be closed by this pull request
@bzbarsky-apple
Copy link
Contributor Author

@andy31415
Copy link
Contributor

fast track: change created and approved by domain owner, up sufficient time for all timezones to have a chance to review.

@andy31415 andy31415 merged commit a8b7f4b into project-chip:master Dec 9, 2021
* The ReadClient object MUST continue to exist after this call is completed. The application shall wait until it
* receives an OnDone call before it shuts down the object.
* The ReadClient object MUST continue to exist after this call is completed. The application shall not shut down the
* object until after this call has returned, and shall not delete the object until OnDone is called.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this actually true? Why can't I shut down this object at any time during the lifetime of this object, including before the subscription is established? I'd think that's actually possible, since that would terminate the open exchange and release this object back into the pool.

Copy link
Contributor

Choose a reason for hiding this comment

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

More-over, ReadClient has still yet to be converted to being application-allocated, so deletion as a concept does not yet apply here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's fair; I think I had lost track of these things being pool allocated (which we want to change) when I was changing the comments here...

I think calling Shutdown "not from inside one of the handlers" is always fine. Doing it from inside the handlers can get us into various corrupted states, though.....

CHIP_ERROR SubscribeAttribute(void * context, ClusterId clusterId, AttributeId attributeId,
ReadResponseSuccessCallback<DecodableArgType> reportCb, ReadResponseFailureCallback failureCb,
uint16_t minIntervalFloorSeconds, uint16_t maxIntervalCeilingSeconds,
SubscriptionEstablishedCallback subscriptionEstablishedCb = nullptr)
Copy link
Contributor

Choose a reason for hiding this comment

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

How do you terminate a subscription after it's been established with such an API? If you were to repeatedly call this with new subscription requests, would that not leak ReadClient's to the point that subscriptions could not be further established?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How do you terminate a subscription after it's been established with such an API?

You don't, just like the API it's a replacement for.

The best you can do is create a new subscription to the same server, which kills the first one on the server and then eventually that gets notified and the ReadClient shut down.

That said, we might in fact want to change this API to hand out the ReadClient so you can shut down the subscription. We want to get our ReadClient lifetime/handle story straight first, right?

@bzbarsky-apple bzbarsky-apple deleted the better-single-attr-subscription branch December 9, 2021 14:41
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.

Expose Subscription liveness callbacks to the application layer
5 participants