Skip to content

Commit 208b1b9

Browse files
Yagoorrlubos
authored andcommitted
[nrf fromtree] Bluetooth: Add configuration to control the dynamic connection callbacks
This commit allows to the user to control the use or not of dynamic connection callbacks. The stack is not using the dynamic connection callbacks so they are only needed if the applications want to use it. Setting it to true for backwards compatibility. With dynamic connection callbacks FLASH: 176600 B 512 KB 33.68% RAM: 27428 B 64 KB 41.85% IDT_LIST: 0 GB 32 KB 0.00% Without dynamic connection callbacks FLASH: 176376 B 512 KB 33.64% RAM: 27428 B 64 KB 41.85% IDT_LIST: 0 GB 32 KB 0.00% Signed-off-by: Yago Fontoura do Rosario <[email protected]> (cherry picked from commit ca06a1d80da97c897c2ee7e786181ab9b7d6e830) Signed-off-by: Sean Madigan <[email protected]>
1 parent 46f3f28 commit 208b1b9

File tree

10 files changed

+223
-104
lines changed

10 files changed

+223
-104
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Disable connection dynamic callbacks
2+
CONFIG_BT_CONN_DYNAMIC_CALLBACKS=n

samples/bluetooth/central_hr/prj_minimal.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ CONFIG_BT_GATT_SERVICE_CHANGED=n
8787
CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS=n
8888
CONFIG_BT_SETTINGS_CCC_LAZY_LOADING=y
8989
CONFIG_BT_HCI_VS=n
90+
CONFIG_BT_CONN_DYNAMIC_CALLBACKS=n
9091

9192
# Disable Bluetooth controller features not needed
9293
CONFIG_BT_CTLR_PRIVACY=n
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Disable connection dynamic callbacks
2+
CONFIG_BT_CONN_DYNAMIC_CALLBACKS=n

samples/bluetooth/peripheral_hr/prj_minimal.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ CONFIG_BT_GATT_SERVICE_CHANGED=n
9393
CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS=n
9494
CONFIG_BT_SETTINGS_CCC_LAZY_LOADING=y
9595
CONFIG_BT_HCI_VS=n
96+
CONFIG_BT_CONN_DYNAMIC_CALLBACKS=n
9697

9798
# Disable Bluetooth controller features not needed
9899
CONFIG_BT_CTLR_PRIVACY=n

subsys/bluetooth/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,16 @@ config BT_LE_EXTENDED_FEAT_SET
131131
Enable support for the LL Extended Feature Set feature.
132132

133133
if BT_CONN
134+
config BT_CONN_DYNAMIC_CALLBACKS
135+
bool "Dynamic connection callbacks"
136+
default y
137+
help
138+
Enable support for dynamic connection callbacks. This links in
139+
bt_conn_cb_register(). Disabling this config is safe. It will make
140+
uses of this and associated APIs fail to link. Note: Static registration
141+
through BT_CONN_CB_DEFINE() is always available and does not depend on
142+
this config.
143+
134144
config BT_HCI_ACL_FLOW_CONTROL
135145
bool "Controller to Host ACL flow control support"
136146
# Enable if building a Host-only build

0 commit comments

Comments
 (0)