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

ESP32: Rotating device ID for BLE transport #13206

Merged
merged 3 commits into from
Jan 4, 2022

Conversation

shubhamdp
Copy link
Contributor

@shubhamdp shubhamdp commented Dec 22, 2021

Problem

Change overview

  • Added additional data flag in BLE service data
  • Added support for rotational device id for ESP32 platform
  • This is an optional feature which can be controlled using config opitons 'chip_enable_additional_data_advertising' and 'chip_enable_rotating_device_id'

Testing

  • Tested manually on Linux and ESP32 platforms using nrfconnect android app
  • On enabling the config options, advertising packet shows an additional byte for additional data flag.
  • It also shows an extra C3 characteristic. When read the characteristic it shows the additional data containing rotational device id.

@github-actions
Copy link

github-actions bot commented Dec 22, 2021

PR #13206: Size comparison from 9a80f75 to 066c183

Decreases (10 builds for efr32, esp32, k32w, linux, mbed, p6, qpg)
platform target config section 9a80f75 066c183 change % change
efr32 lighting-app BRD4161A+rpc (read only) 816552 816536 -16 -0.0
.text 816544 816528 -16 -0.0
window-app BRD4161A (read only) 802372 802356 -16 -0.0
.text 802364 802348 -16 -0.0
esp32 all-clusters-app c3devkit (read only) 884898 882588 -2310 -0.3
(read/write) 1312410 1312402 -8 -0.0
.flash.rodata 176064 176056 -8 -0.0
.flash.text 884898 882588 -2310 -0.3
m5stack (read only) 945471 942807 -2664 -0.3
(read/write) 441528 441512 -16 -0.0
.flash.rodata 202896 202880 -16 -0.0
.flash.text 940087 937423 -2664 -0.3
k32w lock k32w061+release (read/write) 632248 632232 -16 -0.0
.text 548692 548676 -16 -0.0
linux chip-tool-ipv6only arm64 (read only) 6997300 6993476 -3824 -0.1
(read/write) 325841 325761 -80 -0.0
.data.rel.ro 210056 209992 -64 -0.0
.rodata 383884 383676 -208 -0.1
.text 5920036 5916660 -3376 -0.1
mbed all-clusters-app CY8CPROTO_062_4343W+release (read/write) 2341360 2338880 -2480 -0.1
.data 5280 5272 -8 -0.2
.text 1303936 1301456 -2480 -0.2
p6 all-clusters-app default (read/write) 2393688 2390792 -2896 -0.1
.text 1351952 1349056 -2896 -0.2
qpg lighting-app qpg6105+debug (read only) 531192 531184 -8 -0.0
.text 525872 525864 -8 -0.0
lock-app qpg6105+debug (read only) 502860 502852 -8 -0.0
.text 497540 497532 -8 -0.0
Full report (31 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 9a80f75 066c183 change % change
efr32 lighting-app BRD4161A (read only) 828908 828908 0 0.0
(read/write) 127052 127052 0 0.0
.bss 125176 125176 0 0.0
.data 1876 1876 0 0.0
.text 828900 828900 0 0.0
BRD4161A+rpc (read only) 816552 816536 -16 -0.0
(read/write) 143720 143720 0 0.0
.bss 141744 141744 0 0.0
.data 1976 1976 0 0.0
.text 816544 816528 -16 -0.0
window-app BRD4161A (read only) 802372 802356 -16 -0.0
(read/write) 125992 125992 0 0.0
.bss 124160 124160 0 0.0
.data 1832 1832 0 0.0
.text 802364 802348 -16 -0.0
esp32 all-clusters-app c3devkit (read only) 884898 882588 -2310 -0.3
(read/write) 1312410 1312402 -8 -0.0
.dram0.bss 69072 69072 0 0.0
.dram0.data 14220 14220 0 0.0
.flash.rodata 176064 176056 -8 -0.0
.flash.text 884898 882588 -2310 -0.3
.iram0.text 62254 62254 0 0.0
m5stack (read only) 945471 942807 -2664 -0.3
(read/write) 441528 441512 -16 -0.0
.dram0.bss 73568 73568 0 0.0
.dram0.data 34056 34056 0 0.0
.flash.rodata 202896 202880 -16 -0.0
.flash.text 940087 937423 -2664 -0.3
.iram0.text 122671 122671 0 0.0
k32w light k32w061+release (read/write) 647520 647520 0 0.0
.bss 76184 76184 0 0.0
.data 1904 1904 0 0.0
.text 563632 563632 0 0.0
lock k32w061+release (read/write) 632248 632232 -16 -0.0
.bss 75896 75896 0 0.0
.data 1860 1860 0 0.0
.text 548692 548676 -16 -0.0
linux chip-tool-ipv6only arm64 (read only) 6997300 6993476 -3824 -0.1
(read/write) 325841 325761 -80 -0.0
.bss 54209 54209 0 0.0
.data 1096 1096 0 0.0
.data.rel.ro 210056 209992 -64 -0.0
.dynamic 560 560 0 0.0
.got 56776 56776 0 0.0
.init 24 24 0 0.0
.init_array 168 168 0 0.0
.rodata 383884 383676 -208 -0.1
.text 5920036 5916660 -3376 -0.1
thermostat-no-ble arm64 (read only) 2011508 2011508 0 0.0
(read/write) 143937 143937 0 0.0
.bss 63985 63985 0 0.0
.data 880 880 0 0.0
.data.rel.ro 72200 72200 0 0.0
.dynamic 560 560 0 0.0
.got 3936 3936 0 0.0
.init 24 24 0 0.0
.init_array 296 296 0 0.0
.rodata 128468 128468 0 0.0
.text 1670512 1670512 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2341360 2338880 -2480 -0.1
.bss 188332 188332 0 0.0
.data 5280 5272 -8 -0.2
.text 1303936 1301456 -2480 -0.2
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2329160 2329160 0 0.0
.bss 180608 180608 0 0.0
.data 5552 5552 0 0.0
.text 1291760 1291760 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2302192 2302192 0 0.0
.bss 179656 179656 0 0.0
.data 5544 5544 0 0.0
.text 1264792 1264792 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 4368 4368 0 0.0
.text 103392 103392 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2053888 2053888 0 0.0
.bss 156972 156972 0 0.0
.data 4864 4864 0 0.0
.text 1016488 1016488 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 935343 935343 0 0.0
bss 118172 118172 0 0.0
rodata 107996 107996 0 0.0
text 631620 631620 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 921747 921747 0 0.0
bss 115216 115216 0 0.0
rodata 101416 101416 0 0.0
text 626932 626932 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 859110 859110 0 0.0
bss 116456 116456 0 0.0
rodata 102924 102924 0 0.0
text 559060 559060 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 907491 907491 0 0.0
bss 117360 117360 0 0.0
rodata 103304 103304 0 0.0
text 609448 609448 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 831406 831406 0 0.0
bss 115672 115672 0 0.0
rodata 98268 98268 0 0.0
text 536924 536924 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 542351 542351 0 0.0
bss 52588 52588 0 0.0
rodata 50668 50668 0 0.0
text 376892 376892 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 908755 908755 0 0.0
bss 117120 117120 0 0.0
rodata 103520 103520 0 0.0
text 610684 610684 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 905571 905571 0 0.0
bss 117148 117148 0 0.0
rodata 102776 102776 0 0.0
text 608196 608196 0 0.0
shell nrf52840dk_nrf52840 (read/write) 796871 796871 0 0.0
bss 109536 109536 0 0.0
rodata 78200 78200 0 0.0
text 532680 532680 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 709502 709502 0 0.0
bss 107424 107424 0 0.0
rodata 72500 72500 0 0.0
text 450172 450172 0 0.0
p6 all-clusters-app default (read/write) 2393688 2390792 -2896 -0.1
.bss 116532 116532 0 0.0
.data 2552 2552 0 0.0
.text 1351952 1349056 -2896 -0.2
light-app default (read/write) 2323648 2323648 0 0.0
.bss 105856 105856 0 0.0
.data 2384 2384 0 0.0
.text 1281912 1281912 0 0.0
lock-app default (read/write) 2295864 2295864 0 0.0
.bss 104736 104736 0 0.0
.data 2336 2336 0 0.0
.text 1254128 1254128 0 0.0
qpg lighting-app qpg6105+debug (read only) 531192 531184 -8 -0.0
(read/write) 146936 146936 0 0.0
.bss 86656 86656 0 0.0
.data 1004 1004 0 0.0
.text 525872 525864 -8 -0.0
lock-app qpg6105+debug (read only) 502860 502852 -8 -0.0
(read/write) 146940 146940 0 0.0
.bss 85792 85792 0 0.0
.data 952 952 0 0.0
.text 497540 497532 -8 -0.0
persistent-storage-app qpg6105+debug (read only) 106448 106448 0 0.0
(read/write) 146938 146938 0 0.0
.bss 36146 36146 0 0.0
.data 288 288 0 0.0
.text 101128 101128 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 831682 831682 0 0.0
bss 86840 86840 0 0.0
noinit 37160 37160 0 0.0
text 580162 580162 0 0.0

src/app/server/Dnssd.cpp Outdated Show resolved Hide resolved
src/platform/BUILD.gn Show resolved Hide resolved
src/platform/ESP32/BUILD.gn Show resolved Hide resolved
src/platform/ESP32/nimble/BLEManagerImpl.cpp Show resolved Hide resolved
src/platform/ESP32/nimble/BLEManagerImpl.cpp Outdated Show resolved Hide resolved
Also, set the default value of chip_enable_additional_data_advertising
to false in src/platform/BUILD.gn. If this flag is set then Linux and
ESP32 set the Additional Data flag and displayes the C3 characteristic.
Added chip_enable_additional_data_advertising = true to tv-app and
tv-cast-app
Removed the unused characteristic definitions
@shubhamdp shubhamdp force-pushed the esp32_rotating_dev_id branch from 0d36bb1 to 4dc3970 Compare December 24, 2021 06:37
@github-actions
Copy link

github-actions bot commented Dec 24, 2021

PR #13206: Size comparison from 3a617aa to 4dc3970

Decreases (5 builds for k32w, linux, qpg)
platform target config section 3a617aa 4dc3970 change % change
k32w light k32w061+release (read/write) 647440 647424 -16 -0.0
.text 563552 563536 -16 -0.0
lock k32w061+release (read/write) 632264 632248 -16 -0.0
.text 548708 548692 -16 -0.0
linux chip-tool-ipv6only arm64 (read only) 7010188 7006364 -3824 -0.1
(read/write) 324849 324769 -80 -0.0
.data.rel.ro 208960 208896 -64 -0.0
.rodata 383300 383092 -208 -0.1
.text 5934516 5931140 -3376 -0.1
qpg lighting-app qpg6105+debug (read only) 531096 531088 -8 -0.0
.text 525776 525768 -8 -0.0
lock-app qpg6105+debug (read only) 502876 502868 -8 -0.0
.text 497556 497548 -8 -0.0
Full report (31 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 3a617aa 4dc3970 change % change
efr32 lighting-app BRD4161A (read only) 828924 828924 0 0.0
(read/write) 127052 127052 0 0.0
.bss 125176 125176 0 0.0
.data 1876 1876 0 0.0
.text 828916 828916 0 0.0
BRD4161A+rpc (read only) 816552 816552 0 0.0
(read/write) 143720 143720 0 0.0
.bss 141744 141744 0 0.0
.data 1976 1976 0 0.0
.text 816544 816544 0 0.0
window-app BRD4161A (read only) 802372 802372 0 0.0
(read/write) 125992 125992 0 0.0
.bss 124160 124160 0 0.0
.data 1832 1832 0 0.0
.text 802364 802364 0 0.0
esp32 all-clusters-app c3devkit (read only) 882558 882558 0 0.0
(read/write) 1312482 1312482 0 0.0
.dram0.bss 69104 69104 0 0.0
.dram0.data 14220 14220 0 0.0
.flash.rodata 176104 176104 0 0.0
.flash.text 882558 882558 0 0.0
.iram0.text 62254 62254 0 0.0
m5stack (read only) 943035 943035 0 0.0
(read/write) 441592 441592 0 0.0
.dram0.bss 73600 73600 0 0.0
.dram0.data 34056 34056 0 0.0
.flash.rodata 202928 202928 0 0.0
.flash.text 937651 937651 0 0.0
.iram0.text 122671 122671 0 0.0
k32w light k32w061+release (read/write) 647440 647424 -16 -0.0
.bss 76184 76184 0 0.0
.data 1904 1904 0 0.0
.text 563552 563536 -16 -0.0
lock k32w061+release (read/write) 632264 632248 -16 -0.0
.bss 75896 75896 0 0.0
.data 1860 1860 0 0.0
.text 548708 548692 -16 -0.0
linux chip-tool-ipv6only arm64 (read only) 7010188 7006364 -3824 -0.1
(read/write) 324849 324769 -80 -0.0
.bss 54209 54209 0 0.0
.data 1096 1096 0 0.0
.data.rel.ro 208960 208896 -64 -0.0
.dynamic 560 560 0 0.0
.got 56880 56880 0 0.0
.init 24 24 0 0.0
.init_array 168 168 0 0.0
.rodata 383300 383092 -208 -0.1
.text 5934516 5931140 -3376 -0.1
thermostat-no-ble arm64 (read only) 2021852 2021852 0 0.0
(read/write) 143937 143937 0 0.0
.bss 63985 63985 0 0.0
.data 880 880 0 0.0
.data.rel.ro 72200 72200 0 0.0
.dynamic 560 560 0 0.0
.got 3936 3936 0 0.0
.init 24 24 0 0.0
.init_array 296 296 0 0.0
.rodata 128476 128476 0 0.0
.text 1680848 1680848 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2338744 2338744 0 0.0
.bss 188364 188364 0 0.0
.data 5272 5272 0 0.0
.text 1301320 1301320 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2329040 2329040 0 0.0
.bss 180608 180608 0 0.0
.data 5552 5552 0 0.0
.text 1291640 1291640 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2302200 2302200 0 0.0
.bss 179656 179656 0 0.0
.data 5544 5544 0 0.0
.text 1264800 1264800 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 4368 4368 0 0.0
.text 103392 103392 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2053888 2053888 0 0.0
.bss 156972 156972 0 0.0
.data 4864 4864 0 0.0
.text 1016488 1016488 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 935247 935247 0 0.0
bss 118172 118172 0 0.0
rodata 107996 107996 0 0.0
text 631528 631528 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 921651 921651 0 0.0
bss 115216 115216 0 0.0
rodata 101416 101416 0 0.0
text 626840 626840 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 859014 859014 0 0.0
bss 116456 116456 0 0.0
rodata 102924 102924 0 0.0
text 558964 558964 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 907507 907507 0 0.0
bss 117360 117360 0 0.0
rodata 103304 103304 0 0.0
text 609460 609460 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 831422 831422 0 0.0
bss 115672 115672 0 0.0
rodata 98268 98268 0 0.0
text 536940 536940 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 542351 542351 0 0.0
bss 52588 52588 0 0.0
rodata 50668 50668 0 0.0
text 376892 376892 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 908739 908739 0 0.0
bss 117120 117120 0 0.0
rodata 103520 103520 0 0.0
text 610676 610676 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 905587 905587 0 0.0
bss 117148 117148 0 0.0
rodata 102776 102776 0 0.0
text 608208 608208 0 0.0
shell nrf52840dk_nrf52840 (read/write) 796871 796871 0 0.0
bss 109536 109536 0 0.0
rodata 78200 78200 0 0.0
text 532680 532680 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 709502 709502 0 0.0
bss 107424 107424 0 0.0
rodata 72500 72500 0 0.0
text 450172 450172 0 0.0
p6 all-clusters-app default (read/write) 2390856 2390856 0 0.0
.bss 116564 116564 0 0.0
.data 2552 2552 0 0.0
.text 1349120 1349120 0 0.0
light-app default (read/write) 2323680 2323680 0 0.0
.bss 105856 105856 0 0.0
.data 2384 2384 0 0.0
.text 1281944 1281944 0 0.0
lock-app default (read/write) 2295880 2295880 0 0.0
.bss 104736 104736 0 0.0
.data 2336 2336 0 0.0
.text 1254144 1254144 0 0.0
qpg lighting-app qpg6105+debug (read only) 531096 531088 -8 -0.0
(read/write) 146936 146936 0 0.0
.bss 86656 86656 0 0.0
.data 1004 1004 0 0.0
.text 525776 525768 -8 -0.0
lock-app qpg6105+debug (read only) 502876 502868 -8 -0.0
(read/write) 146940 146940 0 0.0
.bss 85792 85792 0 0.0
.data 952 952 0 0.0
.text 497556 497548 -8 -0.0
persistent-storage-app qpg6105+debug (read only) 106448 106448 0 0.0
(read/write) 146938 146938 0 0.0
.bss 36146 36146 0 0.0
.data 288 288 0 0.0
.text 101128 101128 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 831754 831754 0 0.0
bss 86840 86840 0 0.0
noinit 37160 37160 0 0.0
text 580232 580232 0 0.0

@stale
Copy link

stale bot commented Dec 31, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale Stale issue or PR label Dec 31, 2021
@dhrishi
Copy link
Contributor

dhrishi commented Jan 3, 2022

@chrisdecenzo @hnnajh PTAL

@stale stale bot removed the stale Stale issue or PR label Jan 3, 2022
@andy31415 andy31415 merged commit 175218b into project-chip:master Jan 4, 2022
@shubhamdp shubhamdp deleted the esp32_rotating_dev_id branch January 4, 2022 17:39
pankore added a commit to pankore/connectedhomeip that referenced this pull request Jan 5, 2022
Fix BLE can't connect after project-chip#13206
pankore added a commit to pankore/connectedhomeip that referenced this pull request Jan 5, 2022
pankore added a commit to pankore/connectedhomeip that referenced this pull request Jan 5, 2022
pankore added a commit to pankore/connectedhomeip that referenced this pull request Jan 5, 2022
andy31415 pushed a commit that referenced this pull request Jan 5, 2022
step0035 pushed a commit to hank820/connectedhomeip that referenced this pull request Feb 8, 2022
* ESP32: Rotating device ID for BLE transport

* Remove the ifdefs and fix the Zephyr static assert

Also, set the default value of chip_enable_additional_data_advertising
to false in src/platform/BUILD.gn. If this flag is set then Linux and
ESP32 set the Additional Data flag and displayes the C3 characteristic.

* Changed kServiceDataLenSize to kServiceDataTypeSize

Added chip_enable_additional_data_advertising = true to tv-app and
tv-cast-app
Removed the unused characteristic definitions
step0035 pushed a commit to hank820/connectedhomeip that referenced this pull request Feb 8, 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.

No provision for adding GATT-based Additional Data
6 participants