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

[zephyr] Drop BLE connection on endpoint close #14600

Merged
merged 1 commit into from
Feb 1, 2022

Conversation

Damian-Nordic
Copy link
Contributor

Problem

When a BLE endpoint is closed on the peripheral side, the associated connection is not automatically closed. Instead, BlePlatformDelegate::NotifyChipConnectionClosed() is called, but the function is empty for Zephyr and many other platforms.

Change overview

Implement connection closing for Zephyr platform.

Testing

Tested on nRF Connect examples that CASEServer.cpp code which closes all BLE endpoints in reponse to Sigma1 message now truly closes the BLE connection.

When a BLE endpoint is closed on the peripheral side, the
associated connection is not automatically closed. Instead,
BlePlatformDelegate::NotifyChipConnectionClosed() is called,
but the function is empty for Zephyr and many other
platforms.

Implement connection closing for Zephyr platform.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
@github-actions
Copy link

github-actions bot commented Jan 31, 2022

PR #14600: Size comparison from 8a0aab9 to 89cb18e

Increases (9 builds for nrfconnect)
platform target config section 8a0aab9 89cb18e change % change
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 978979 978995 16 0.0
text 667216 667224 8 0.0
nrf52840dk_nrf52840+rpc (read/write) 964555 964571 16 0.0
text 663660 663668 8 0.0
nrf52840dongle_nrf52840 text 672608 672616 8 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 888178 888194 16 0.0
text 583400 583408 8 0.0
lock-app nrf52840dk_nrf52840 (read/write) 911623 911639 16 0.0
text 613248 613256 8 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 821670 821686 16 0.0
text 530212 530220 8 0.0
pump-app nrf52840dk_nrf52840 (read/write) 914495 914511 16 0.0
text 615772 615780 8 0.0
pump-controller-app nrf52840dk_nrf52840 text 611820 611828 8 0.0
shell nrf52840dk_nrf52840 (read/write) 798379 798395 16 0.0
text 533752 533760 8 0.0
Full report (42 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 8a0aab9 89cb18e change % change
cyw30739 light cyw930739m2evb_01 (read/write) 575582 575582 0 0.0
.app_xip_area 482804 482804 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) 533602 533602 0 0.0
.app_xip_area 442400 442400 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) 828856 828856 0 0.0
(read/write) 141712 141712 0 0.0
.bss 139720 139720 0 0.0
.data 1992 1992 0 0.0
.text 828848 828848 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) 932520 932520 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 932520 932520 0 0.0
.iram0.text 62056 62056 0 0.0
m5stack (read only) 980491 980491 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 975107 975107 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) 2289225 2289225 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 202757 202757 0 0.0
.text 1925810 1925810 0 0.0
bridge-app debug+rpc (read only) 1625781 1625781 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 137300 137300 0 0.0
.text 1373653 1373653 0 0.0
chip-tool debug (read only) 7032029 7032029 0 0.0
(read/write) 186568 186568 0 0.0
.bss 36264 36264 0 0.0
.data 1088 1088 0 0.0
.data.rel.ro 143248 143248 0 0.0
.dynamic 608 608 0 0.0
.got 4744 4744 0 0.0
.init 27 27 0 0.0
.init_array 600 600 0 0.0
.rodata 403893 403893 0 0.0
.text 6263925 6263925 0 0.0
chip-tool-ipv6only arm64 (read only) 6985972 6985972 0 0.0
(read/write) 288945 288945 0 0.0
.bss 54593 54593 0 0.0
.data 1128 1128 0 0.0
.data.rel.ro 184384 184384 0 0.0
.dynamic 560 560 0 0.0
.got 45072 45072 0 0.0
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 387068 387068 0 0.0
.text 6002436 6002436 0 0.0
door-lock-app debug (read only) 1846705 1846705 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 170556 170556 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) 1625761 1625761 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 147230 147230 0 0.0
.text 1361426 1361426 0 0.0
ota-requestor-app debug (read only) 1634521 1634521 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 143503 143503 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) 2400673 2400673 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 190924 190924 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) 2382064 2382064 0 0.0
.bss 187884 187884 0 0.0
.data 5288 5288 0 0.0
.text 1344664 1344664 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2336632 2336632 0 0.0
.bss 178160 178160 0 0.0
.data 5568 5568 0 0.0
.text 1299232 1299232 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2300736 2300736 0 0.0
.bss 178040 178040 0 0.0
.data 5544 5544 0 0.0
.text 1263336 1263336 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 978995 16 0.0
bss 118528 118528 0 0.0
rodata 115464 115464 0 0.0
text 667216 667224 8 0.0
nrf52840dk_nrf52840+rpc (read/write) 964555 964571 16 0.0
bss 115572 115572 0 0.0
rodata 106936 106936 0 0.0
text 663660 663668 8 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 672616 8 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 888178 888194 16 0.0
bss 115316 115316 0 0.0
rodata 108740 108740 0 0.0
text 583400 583408 8 0.0
lock-app nrf52840dk_nrf52840 (read/write) 911623 911639 16 0.0
bss 116888 116888 0 0.0
rodata 104100 104100 0 0.0
text 613248 613256 8 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 821670 821686 16 0.0
bss 113704 113704 0 0.0
rodata 97304 97304 0 0.0
text 530212 530220 8 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 914511 16 0.0
bss 116644 116644 0 0.0
rodata 104612 104612 0 0.0
text 615772 615780 8 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 611828 8 0.0
shell nrf52840dk_nrf52840 (read/write) 798379 798395 16 0.0
bss 109776 109776 0 0.0
rodata 78352 78352 0 0.0
text 533752 533760 8 0.0
p6 all-clusters-app default (read/write) 2442616 2442616 0 0.0
.bss 116028 116028 0 0.0
.data 2576 2576 0 0.0
.text 1400880 1400880 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) 569648 569648 0 0.0
(read/write) 146940 146940 0 0.0
.bss 87504 87504 0 0.0
.data 1056 1056 0 0.0
.text 564328 564328 0 0.0
lock-app qpg6105+debug (read only) 515764 515764 0 0.0
(read/write) 146940 146940 0 0.0
.bss 86944 86944 0 0.0
.data 992 992 0 0.0
.text 510444 510444 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) 843362 843362 0 0.0
bss 85552 85552 0 0.0
noinit 37160 37160 0 0.0
text 591236 591236 0 0.0

@bzbarsky-apple bzbarsky-apple merged commit da22674 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.

4 participants