From bca927e2032fb28a3844f787bee683a3b0837a07 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Sat, 11 Mar 2023 10:57:21 +0100 Subject: [PATCH] nrf52/nrf53/sdc: define BLE max connection if NET_BLUETOOTH=n --- arch/arm/src/nrf52/Kconfig | 7 +++++++ arch/arm/src/nrf52/nrf52_sdc.c | 8 +++++++- arch/arm/src/nrf53/Kconfig | 7 +++++++ arch/arm/src/nrf53/nrf53_sdc.c | 8 +++++++- 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/arch/arm/src/nrf52/Kconfig b/arch/arm/src/nrf52/Kconfig index 9e7e5add0e..03be65fcd9 100644 --- a/arch/arm/src/nrf52/Kconfig +++ b/arch/arm/src/nrf52/Kconfig @@ -710,9 +710,16 @@ config NRF52_SDC_PERIPHERAL_COUNT determines the number of central roles from the following: CENTRAL_ROLES = CONFIG_BLUETOOTH_MAX_CONN - NRF52_SDC_PERIPHERAL_COUNT + or + CENTRAL_ROLES = NRF52_SDC_MAX_COUNT - NRF52_SDC_PERIPHERAL_COUNT So by choosing these two variables you can control both capabilities. +config NRF52_SDC_MAX_COUNT + int "Maximum number of roles to support" + default 1 + depends on !NET_BLUETOOTH + config NRF52_SDC_ADVERTISING bool "Support advertising" default y diff --git a/arch/arm/src/nrf52/nrf52_sdc.c b/arch/arm/src/nrf52/nrf52_sdc.c index 1fb3124ca7..dfcf227b43 100644 --- a/arch/arm/src/nrf52/nrf52_sdc.c +++ b/arch/arm/src/nrf52/nrf52_sdc.c @@ -58,6 +58,12 @@ /* Connections configuration ************************************************/ +/* If NET_BLUETOOTH not defined */ + +#ifndef CONFIG_BLUETOOTH_MAX_CONN +# define CONFIG_BLUETOOTH_MAX_CONN CONFIG_NRF52_SDC_MAX_COUNT +#endif + #if defined(CONFIG_SDC_PERIPHERAL_COUNT) && \ CONFIG_SDC_PERIPHERAL_COUNT > CONFIG_BLUETOOTH_MAX_CONN # error "Cannot support more BLE peripheral roles than connections" @@ -270,7 +276,7 @@ static int bt_open(struct bt_driver_s *btdev) } /**************************************************************************** - * Name: bt_open + * Name: bt_hci_send ****************************************************************************/ static int bt_hci_send(struct bt_driver_s *btdev, diff --git a/arch/arm/src/nrf53/Kconfig b/arch/arm/src/nrf53/Kconfig index d9469c8d89..4b40cece5a 100644 --- a/arch/arm/src/nrf53/Kconfig +++ b/arch/arm/src/nrf53/Kconfig @@ -435,9 +435,16 @@ config NRF53_SDC_PERIPHERAL_COUNT determines the number of central roles from the following: CENTRAL_ROLES = CONFIG_BLUETOOTH_MAX_CONN - NRF53_SDC_PERIPHERAL_COUNT + or + CENTRAL_ROLES = NRF52_SDC_MAX_COUNT - NRF52_SDC_PERIPHERAL_COUNT So by choosing these two variables you can control both capabilities. +config NRF53_SDC_MAX_COUNT + int "Maximum number of roles to support" + default 1 + depends on !NET_BLUETOOTH + config NRF53_SDC_ADVERTISING bool "Support advertising" default y diff --git a/arch/arm/src/nrf53/nrf53_sdc.c b/arch/arm/src/nrf53/nrf53_sdc.c index ad0878b64c..4051153c92 100644 --- a/arch/arm/src/nrf53/nrf53_sdc.c +++ b/arch/arm/src/nrf53/nrf53_sdc.c @@ -62,6 +62,12 @@ /* Connections configuration ************************************************/ +/* If NET_BLUETOOTH not defined */ + +#ifndef CONFIG_NET_BLUETOOTH +# define CONFIG_BLUETOOTH_MAX_CONN CONFIG_NRF53_SDC_MAX_COUNT +#endif + #if defined(CONFIG_SDC_PERIPHERAL_COUNT) && \ CONFIG_SDC_PERIPHERAL_COUNT > CONFIG_BLUETOOTH_MAX_CONN # error "Cannot support more BLE peripheral roles than connections" @@ -261,7 +267,7 @@ static int bt_open(struct bt_driver_s *btdev) } /**************************************************************************** - * Name: bt_open + * Name: bt_hci_send ****************************************************************************/ static int bt_hci_send(struct bt_driver_s *btdev,