Skip to content

Commit 3880c97

Browse files
committed
Add config for enabling LE Secure Connections.
* Enabled by default for nRF52840, nRF52833 and nRF52832, disabled for all others due to code size.
1 parent ab9a4a3 commit 3880c97

File tree

5 files changed

+25
-5
lines changed

5 files changed

+25
-5
lines changed

cores/nRF5/nimble_config/nrf51_nimconfig.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@
8383
#define CONFIG_NIMBLE_STACK_USE_MEM_POOLS 0
8484
#endif
8585

86+
#ifndef MYNEWT_VAL_BLE_SM_SC
87+
#define MYNEWT_VAL_BLE_SM_SC (CONFIG_NIMBLE_USE_SECURE_CONNECTIONS)
88+
#endif
89+
8690
#ifdef USE_LFRC
8791
#define MYNEWT_VAL_BLE_LL_SCA (500)
8892
#endif
@@ -719,7 +723,7 @@
719723
#endif
720724

721725
#ifndef MYNEWT_VAL_BLE_SM_SC
722-
#define MYNEWT_VAL_BLE_SM_SC (0)
726+
#define MYNEWT_VAL_BLE_SM_SC (CONFIG_NIMBLE_USE_SECURE_CONNECTIONS)
723727
#endif
724728

725729
#ifndef MYNEWT_VAL_BLE_SM_SC_DEBUG_KEYS

cores/nRF5/nimble_config/nrf52810_nimconfig.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@
7171
#define CONFIG_NIMBLE_STACK_USE_MEM_POOLS 0
7272
#endif
7373

74+
#ifndef CONFIG_NIMBLE_USE_SECURE_CONNECTIONS
75+
#define CONFIG_NIMBLE_USE_SECURE_CONNECTIONS 0
76+
#endif
77+
7478
#if CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV && !CONFIG_BT_NIMBLE_EXT_ADV
7579
# error Extended advertising must be enabled to use periodic advertising.
7680
#endif
@@ -740,7 +744,7 @@
740744
#endif
741745

742746
#ifndef MYNEWT_VAL_BLE_SM_SC
743-
#define MYNEWT_VAL_BLE_SM_SC (0)
747+
#define MYNEWT_VAL_BLE_SM_SC (CONFIG_NIMBLE_USE_SECURE_CONNECTIONS)
744748
#endif
745749

746750
#ifndef MYNEWT_VAL_BLE_SM_SC_DEBUG_KEYS

cores/nRF5/nimble_config/nrf52832_nimconfig.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@
7171
#define CONFIG_NIMBLE_STACK_USE_MEM_POOLS 0
7272
#endif
7373

74+
#ifndef CONFIG_NIMBLE_USE_SECURE_CONNECTIONS
75+
#define CONFIG_NIMBLE_USE_SECURE_CONNECTIONS 1
76+
#endif
77+
7478
#if CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV && !CONFIG_BT_NIMBLE_EXT_ADV
7579
# error Extended advertising must be enabled to use periodic advertising.
7680
#endif
@@ -740,7 +744,7 @@
740744
#endif
741745

742746
#ifndef MYNEWT_VAL_BLE_SM_SC
743-
#define MYNEWT_VAL_BLE_SM_SC (0)
747+
#define MYNEWT_VAL_BLE_SM_SC (CONFIG_NIMBLE_USE_SECURE_CONNECTIONS)
744748
#endif
745749

746750
#ifndef MYNEWT_VAL_BLE_SM_SC_DEBUG_KEYS

cores/nRF5/nimble_config/nrf52833_nimconfig.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@
7171
#define CONFIG_NIMBLE_STACK_USE_MEM_POOLS 0
7272
#endif
7373

74+
#ifndef CONFIG_NIMBLE_USE_SECURE_CONNECTIONS
75+
#define CONFIG_NIMBLE_USE_SECURE_CONNECTIONS 1
76+
#endif
77+
7478
#if CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV && !CONFIG_BT_NIMBLE_EXT_ADV
7579
# error Extended advertising must be enabled to use periodic advertising.
7680
#endif
@@ -740,7 +744,7 @@
740744
#endif
741745

742746
#ifndef MYNEWT_VAL_BLE_SM_SC
743-
#define MYNEWT_VAL_BLE_SM_SC (0)
747+
#define MYNEWT_VAL_BLE_SM_SC (CONFIG_NIMBLE_USE_SECURE_CONNECTIONS)
744748
#endif
745749

746750
#ifndef MYNEWT_VAL_BLE_SM_SC_DEBUG_KEYS

cores/nRF5/nimble_config/nrf52840_nimconfig.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@
7171
#define CONFIG_NIMBLE_STACK_USE_MEM_POOLS 0
7272
#endif
7373

74+
#ifndef CONFIG_NIMBLE_USE_SECURE_CONNECTIONS
75+
#define CONFIG_NIMBLE_USE_SECURE_CONNECTIONS 1
76+
#endif
77+
7478
#if CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV && !CONFIG_BT_NIMBLE_EXT_ADV
7579
# error Extended advertising must be enabled to use periodic advertising.
7680
#endif
@@ -740,7 +744,7 @@
740744
#endif
741745

742746
#ifndef MYNEWT_VAL_BLE_SM_SC
743-
#define MYNEWT_VAL_BLE_SM_SC (0)
747+
#define MYNEWT_VAL_BLE_SM_SC (CONFIG_NIMBLE_USE_SECURE_CONNECTIONS)
744748
#endif
745749

746750
#ifndef MYNEWT_VAL_BLE_SM_SC_DEBUG_KEYS

0 commit comments

Comments
 (0)