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

Darwin framework: add replacement subscribe method that includes event report #17436

Conversation

jtung-apple
Copy link
Contributor

Problem

Change overview

  • zapt templates to generate Obj-C objects corresponding to C++ event structs
  • zapt template to populate these objects from events TLVReader
  • new CHIPDevice subscribeWithQueue method with eventReporterHandler and logic to hook up the handler with the callback mechanism

Testing

Work-in-progress - will update testing details later.

@boring-cyborg boring-cyborg bot added the darwin label Apr 16, 2022
@CLAassistant
Copy link

CLAassistant commented Apr 16, 2022

CLA assistant check
All committers have signed the CLA.

@jtung-apple
Copy link
Contributor Author

Tested this with chip-tool-darwin and locally modified Commands.h. I'll make a separate change to add a test to chip-tool-darwin.

src/darwin/Framework/CHIP/CHIPDevice.mm Show resolved Hide resolved
src/darwin/Framework/CHIP/CHIPDevice.mm Outdated Show resolved Hide resolved
src/darwin/Framework/CHIP/CHIPDevice.h Outdated Show resolved Hide resolved
src/darwin/Framework/CHIP/CHIPDevice.mm Outdated Show resolved Hide resolved
@jtung-apple jtung-apple force-pushed the issue-16691-event-subscription-darwin branch from 3b7b609 to 056f660 Compare April 25, 2022 18:22
src/darwin/Framework/CHIP/CHIPDevice.h Outdated Show resolved Hide resolved
src/darwin/Framework/CHIP/CHIPDevice.h Outdated Show resolved Hide resolved
@bzbarsky-apple
Copy link
Contributor

Fast-tracking platform-specific code.

@github-actions
Copy link

github-actions bot commented Apr 25, 2022

PR #17436: Size comparison from 252314f to a34604f

Increases above 0.2%:

platform target config section 252314f a34604f change % change
linux all-clusters-app debug .init_array 984 992 8 0.8
.rodata 233381 233861 480 0.2
bridge-app debug+rpc (read only) 1847941 1890689 42748 2.3
(read/write) 115248 120304 5056 4.4
.bss 67368 71168 3800 5.6
.data 3072 3424 352 11.5
.data.rel.ro 39704 40392 688 1.7
.got 3936 4032 96 2.4
.init_array 544 680 136 25.0
.rodata 149089 159633 10544 7.1
.text 1579669 1608322 28653 1.8
lighting-app debug+rpc .init_array 776 784 8 1.0
.rodata 183281 183697 416 0.2
lock-app debug .init_array 720 728 8 1.1
.rodata 189601 190049 448 0.2
ota-provider-app debug .init_array 632 640 8 1.3
.rodata 173723 174235 512 0.3
ota-requestor-app debug .init_array 656 664 8 1.2
.rodata 170076 170588 512 0.3
tv-app debug .init_array 912 920 8 0.9
.rodata 215531 215979 448 0.2
Increases (10 builds for linux)
platform target config section 252314f a34604f change % change
linux all-clusters-app debug (read only) 2734185 2734705 520 0.0
.init_array 984 992 8 0.8
.rodata 233381 233861 480 0.2
.text 2325890 2326050 160 0.0
bridge-app debug+rpc (read only) 1847941 1890689 42748 2.3
(read/write) 115248 120304 5056 4.4
.bss 67368 71168 3800 5.6
.data 3072 3424 352 11.5
.data.rel.ro 39704 40392 688 1.7
.got 3936 4032 96 2.4
.init_array 544 680 136 25.0
.rodata 149089 159633 10544 7.1
.text 1579669 1608322 28653 1.8
chip-tool debug (read only) 10944429 10944493 64 0.0
.text 9557173 9557237 64 0.0
chip-tool-no-interactive-ipv6only arm64 (read only) 10555836 10555900 64 0.0
.text 8916804 8916868 64 0.0
lighting-app debug+rpc (read only) 2325673 2326129 456 0.0
.init_array 776 784 8 1.0
.rodata 183281 183697 416 0.2
.text 1975682 1975842 160 0.0
lock-app debug (read only) 2151977 2152465 488 0.0
.init_array 720 728 8 1.1
.rodata 189601 190049 448 0.2
.text 1805186 1805346 160 0.0
ota-provider-app debug (read only) 2058537 2059217 680 0.0
(read/write) 138880 138888 8 0.0
.init_array 632 640 8 1.3
.rodata 173723 174235 512 0.3
.text 1727378 1727522 144 0.0
ota-requestor-app debug (read only) 2089785 2090465 680 0.0
.init_array 656 664 8 1.2
.rodata 170076 170588 512 0.3
.text 1760786 1760930 144 0.0
thermostat-no-ble arm64 (read only) 2367532 2367612 80 0.0
.rodata 145308 145484 176 0.1
.text 1993024 1993072 48 0.0
tv-app debug (read only) 2843681 2844233 552 0.0
.init_array 912 920 8 0.9
.rodata 215531 215979 448 0.2
.text 2445618 2445842 224 0.0
Decreases (27 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 252314f a34604f change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 692119 692071 -48 -0.0
(read/write) 159968 159952 -16 -0.0
.bss 75072 75008 -64 -0.1
.rodata 106015 105967 -48 -0.0
lock-ftd LP_CC2652R7 (read only) 678635 678587 -48 -0.0
(read/write) 164756 164748 -8 -0.0
.bss 73432 73376 -56 -0.1
.rodata 98851 98803 -48 -0.0
lock-mtd LP_CC2652R7 (read only) 627379 627331 -48 -0.0
(read/write) 146228 146172 -56 -0.0
.bss 69152 69096 -56 -0.1
.rodata 98731 98683 -48 -0.0
pump-app LP_CC2652R7 (read/write) 151692 151684 -8 -0.0
.bss 73560 73552 -8 -0.0
cyw30739 light cyw930739m2evb_01 (read/write) 623542 623430 -112 -0.0
.app_xip_area 526356 526308 -48 -0.0
.bss 79844 79780 -64 -0.1
lock cyw930739m2evb_01 (read/write) 618498 618394 -104 -0.0
.app_xip_area 522792 522744 -48 -0.0
.bss 78396 78340 -56 -0.1
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 571134 571126 -8 -0.0
.bss 87688 87680 -8 -0.0
efr32 lighting-app BRD4161A (read only) 907520 907472 -48 -0.0
(read/write) 134968 134912 -56 -0.0
.bss 132920 132864 -56 -0.0
.text 907512 907464 -48 -0.0
BRD4161A+rpc (read only) 941936 941888 -48 -0.0
(read/write) 151648 151592 -56 -0.0
.bss 149400 149344 -56 -0.0
.text 941928 941880 -48 -0.0
window-app BRD4161A (read only) 845008 844960 -48 -0.0
(read/write) 133056 133000 -56 -0.0
.bss 131096 131040 -56 -0.0
.text 845000 844952 -48 -0.0
esp32 all-clusters-app c3devkit (read/write) 1473730 1473634 -96 -0.0
.dram0.bss 68224 68168 -56 -0.1
.flash.rodata 206632 206584 -48 -0.0
m5stack (read/write) 475728 475624 -104 -0.0
.dram0.bss 73744 73688 -56 -0.1
.flash.rodata 235980 235932 -48 -0.0
k32w light k32w061+release (read/write) 688808 688704 -104 -0.0
.bss 81168 81112 -56 -0.1
.text 599840 599792 -48 -0.0
lock k32w061+release (read/write) 729676 729572 -104 -0.0
.bss 81576 81520 -56 -0.1
.text 640340 640292 -48 -0.0
linux all-clusters-app debug (read/write) 172864 172840 -24 -0.0
.bss 83168 83136 -32 -0.0
lighting-app debug+rpc (read/write) 151280 151256 -24 -0.0
.bss 73248 73216 -32 -0.0
lock-app debug (read/write) 143512 143488 -24 -0.0
.bss 71040 71008 -32 -0.0
ota-requestor-app debug (read/write) 141688 141664 -24 -0.0
.bss 71904 71872 -32 -0.0
shell debug (read only) 2560649 2560473 -176 -0.0
(read/write) 196840 196808 -32 -0.0
.bss 113800 113768 -32 -0.0
.rodata 215570 215538 -32 -0.0
thermostat-no-ble arm64 (read/write) 174401 174353 -48 -0.0
.bss 86145 86097 -48 -0.1
tv-app debug (read/write) 276592 276536 -56 -0.0
.bss 189176 189112 -64 -0.0
mbed lock-app CY8CPROTO_062_4343W+release (read/write) 2411396 2411348 -48 -0.0
.bss 205716 205660 -56 -0.0
.text 1373996 1373948 -48 -0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1177531 1177355 -176 -0.0
bss 141840 141784 -56 -0.0
rodata 150124 150076 -48 -0.0
p6 all-clusters-app default (read/write) 2526888 2526840 -48 -0.0
.bss 139096 139040 -56 -0.0
.text 1485152 1485104 -48 -0.0
light-app default (read/write) 2418640 2418592 -48 -0.0
.bss 132576 132520 -56 -0.0
.text 1376904 1376856 -48 -0.0
lock-app default (read/write) 2422832 2422784 -48 -0.0
.bss 132376 132320 -56 -0.0
.text 1381096 1381048 -48 -0.0
telink lighting-app tlsr9518adk80d (read/write) 807984 807880 -104 -0.0
bss 75272 75216 -56 -0.1
Full report (32 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 252314f a34604f change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 692119 692071 -48 -0.0
(read/write) 159968 159952 -16 -0.0
.bss 75072 75008 -64 -0.1
.data 3396 3396 0 0.0
.rodata 106015 105967 -48 -0.0
.text 585624 585624 0 0.0
lock-ftd LP_CC2652R7 (read only) 678635 678587 -48 -0.0
(read/write) 164756 164748 -8 -0.0
.bss 73432 73376 -56 -0.1
.data 3220 3220 0 0.0
.rodata 98851 98803 -48 -0.0
.text 579300 579300 0 0.0
lock-mtd LP_CC2652R7 (read only) 627379 627331 -48 -0.0
(read/write) 146228 146172 -56 -0.0
.bss 69152 69096 -56 -0.1
.data 3220 3220 0 0.0
.rodata 98731 98683 -48 -0.0
.text 528156 528156 0 0.0
pump-app LP_CC2652R7 (read only) 651071 651071 0 0.0
(read/write) 151692 151684 -8 -0.0
.bss 73560 73552 -8 -0.0
.data 3252 3252 0 0.0
.rodata 75703 75703 0 0.0
.text 574880 574880 0 0.0
pump-controller-app LP_CC2652R7 (read only) 644139 644139 0 0.0
(read/write) 151440 151440 0 0.0
.bss 73600 73600 0 0.0
.data 3216 3216 0 0.0
.rodata 78835 78835 0 0.0
.text 564816 564816 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 623542 623430 -112 -0.0
.app_xip_area 526356 526308 -48 -0.0
.bss 79844 79780 -64 -0.1
.data 692 692 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 618498 618394 -104 -0.0
.app_xip_area 522792 522744 -48 -0.0
.bss 78396 78340 -56 -0.1
.data 656 656 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 571134 571126 -8 -0.0
.app_xip_area 465840 465840 0 0.0
.bss 87688 87680 -8 -0.0
.data 568 568 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 907520 907472 -48 -0.0
(read/write) 134968 134912 -56 -0.0
.bss 132920 132864 -56 -0.0
.data 2044 2044 0 0.0
.text 907512 907464 -48 -0.0
BRD4161A+rpc (read only) 941936 941888 -48 -0.0
(read/write) 151648 151592 -56 -0.0
.bss 149400 149344 -56 -0.0
.data 2248 2248 0 0.0
.text 941928 941880 -48 -0.0
window-app BRD4161A (read only) 845008 844960 -48 -0.0
(read/write) 133056 133000 -56 -0.0
.bss 131096 131040 -56 -0.0
.data 1956 1956 0 0.0
.text 845000 844952 -48 -0.0
esp32 all-clusters-app c3devkit (read only) 999334 999334 0 0.0
(read/write) 1473730 1473634 -96 -0.0
.dram0.bss 68224 68168 -56 -0.1
.dram0.data 14428 14428 0 0.0
.flash.rodata 206632 206584 -48 -0.0
.flash.text 999334 999334 0 0.0
.iram0.text 62020 62020 0 0.0
m5stack (read only) 1053575 1053575 0 0.0
(read/write) 475728 475624 -104 -0.0
.dram0.bss 73744 73688 -56 -0.1
.dram0.data 34168 34168 0 0.0
.flash.rodata 235980 235932 -48 -0.0
.flash.text 1048191 1048191 0 0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 688808 688704 -104 -0.0
.bss 81168 81112 -56 -0.1
.data 2000 2000 0 0.0
.text 599840 599792 -48 -0.0
lock k32w061+release (read/write) 729676 729572 -104 -0.0
.bss 81576 81520 -56 -0.1
.data 1960 1960 0 0.0
.text 640340 640292 -48 -0.0
linux all-clusters-app debug (read only) 2734185 2734705 520 0.0
(read/write) 172864 172840 -24 -0.0
.bss 83168 83136 -32 -0.0
.data 1984 1984 0 0.0
.data.rel.ro 81624 81624 0 0.0
.dynamic 608 608 0 0.0
.got 4464 4464 0 0.0
.init 27 27 0 0.0
.init_array 984 992 8 0.8
.rodata 233381 233861 480 0.2
.text 2325890 2326050 160 0.0
bridge-app debug+rpc (read only) 1847941 1890689 42748 2.3
(read/write) 115248 120304 5056 4.4
.bss 67368 71168 3800 5.6
.data 3072 3424 352 11.5
.data.rel.ro 39704 40392 688 1.7
.dynamic 592 592 0 0.0
.got 3936 4032 96 2.4
.init 27 27 0 0.0
.init_array 544 680 136 25.0
.rodata 149089 159633 10544 7.1
.text 1579669 1608322 28653 1.8
chip-tool debug (read only) 10944429 10944493 64 0.0
(read/write) 375760 375760 0 0.0
.bss 22592 22592 0 0.0
.data 1136 1136 0 0.0
.data.rel.ro 345768 345768 0 0.0
.dynamic 624 624 0 0.0
.got 4952 4952 0 0.0
.init 27 27 0 0.0
.init_array 648 648 0 0.0
.rodata 547349 547349 0 0.0
.text 9557173 9557237 64 0.0
chip-tool-no-interactive-ipv6only arm64 (read only) 10555836 10555900 64 0.0
(read/write) 497681 497681 0 0.0
.bss 40897 40897 0 0.0
.data 1192 1192 0 0.0
.data.rel.ro 393088 393088 0 0.0
.dynamic 560 560 0 0.0
.got 58680 58680 0 0.0
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 521228 521228 0 0.0
.text 8916804 8916868 64 0.0
lighting-app debug+rpc (read only) 2325673 2326129 456 0.0
(read/write) 151280 151256 -24 -0.0
.bss 73248 73216 -32 -0.0
.data 1984 1984 0 0.0
.data.rel.ro 70328 70328 0 0.0
.dynamic 608 608 0 0.0
.got 4320 4320 0 0.0
.init 27 27 0 0.0
.init_array 776 784 8 1.0
.rodata 183281 183697 416 0.2
.text 1975682 1975842 160 0.0
lock-app debug (read only) 2151977 2152465 488 0.0
(read/write) 143512 143488 -24 -0.0
.bss 71040 71008 -32 -0.0
.data 1504 1504 0 0.0
.data.rel.ro 65368 65368 0 0.0
.dynamic 592 592 0 0.0
.got 4280 4280 0 0.0
.init 27 27 0 0.0
.init_array 720 728 8 1.1
.rodata 189601 190049 448 0.2
.text 1805186 1805346 160 0.0
ota-provider-app debug (read only) 2058537 2059217 680 0.0
(read/write) 138880 138888 8 0.0
.bss 71232 71232 0 0.0
.data 1672 1672 0 0.0
.data.rel.ro 60216 60216 0 0.0
.dynamic 608 608 0 0.0
.got 4480 4480 0 0.0
.init 27 27 0 0.0
.init_array 632 640 8 1.3
.rodata 173723 174235 512 0.3
.text 1727378 1727522 144 0.0
ota-requestor-app debug (read only) 2089785 2090465 680 0.0
(read/write) 141688 141664 -24 -0.0
.bss 71904 71872 -32 -0.0
.data 1928 1928 0 0.0
.data.rel.ro 62248 62248 0 0.0
.dynamic 592 592 0 0.0
.got 4320 4320 0 0.0
.init 27 27 0 0.0
.init_array 656 664 8 1.2
.rodata 170076 170588 512 0.3
.text 1760786 1760930 144 0.0
shell debug (read only) 2560649 2560473 -176 -0.0
(read/write) 196840 196808 -32 -0.0
.bss 113800 113768 -32 -0.0
.data 1360 1360 0 0.0
.data.rel.ro 75952 75952 0 0.0
.dynamic 592 592 0 0.0
.got 4184 4184 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 215570 215538 -32 -0.0
.text 2183074 2183074 0 0.0
thermostat-no-ble arm64 (read only) 2367532 2367612 80 0.0
(read/write) 174401 174353 -48 -0.0
.bss 86145 86097 -48 -0.1
.data 1488 1488 0 0.0
.data.rel.ro 78992 78992 0 0.0
.dynamic 560 560 0 0.0
.got 4744 4744 0 0.0
.init 24 24 0 0.0
.init_array 368 368 0 0.0
.rodata 145308 145484 176 0.1
.text 1993024 1993072 48 0.0
tv-app debug (read only) 2843681 2844233 552 0.0
(read/write) 276592 276536 -56 -0.0
.bss 189176 189112 -64 -0.0
.data 4640 4640 0 0.0
.data.rel.ro 76560 76560 0 0.0
.dynamic 592 592 0 0.0
.got 4696 4696 0 0.0
.init 27 27 0 0.0
.init_array 912 920 8 0.9
.rodata 215531 215979 448 0.2
.text 2445618 2445842 224 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2411396 2411348 -48 -0.0
.bss 205716 205660 -56 -0.0
.data 5848 5848 0 0.0
.text 1373996 1373948 -48 -0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1177531 1177355 -176 -0.0
bss 141840 141784 -56 -0.0
rodata 150124 150076 -48 -0.0
text 806852 806852 0 0.0
p6 all-clusters-app default (read/write) 2526888 2526840 -48 -0.0
.bss 139096 139040 -56 -0.0
.data 2784 2784 0 0.0
.text 1485152 1485104 -48 -0.0
light-app default (read/write) 2418640 2418592 -48 -0.0
.bss 132576 132520 -56 -0.0
.data 2584 2584 0 0.0
.text 1376904 1376856 -48 -0.0
lock-app default (read/write) 2422832 2422784 -48 -0.0
.bss 132376 132320 -56 -0.0
.data 2544 2544 0 0.0
.text 1381096 1381048 -48 -0.0
telink lighting-app tlsr9518adk80d (read/write) 807984 807880 -104 -0.0
bss 75272 75216 -56 -0.1
noinit 40416 40416 0 0.0
text 571680 571680 0 0.0

@bzbarsky-apple bzbarsky-apple merged commit 5ab3439 into project-chip:master Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants