Skip to content

Commit

Permalink
Bluetooth: Limit BT_CTLR_SDC_PAWR_ADV_COUNT by maximum advertising sets
Browse files Browse the repository at this point in the history
Periodic advertiser is allocated from the PAwR Advertiser sets when the
number of Periodic Advertising with Responses advertisers is available.

The sum of periodic advertiser and periodic advertiser with responses
will not be over the maximum advertising sets.

Signed-off-by: Ryan Chu <ryan.chu@nordicsemi.no>
  • Loading branch information
ryanjh authored and rlubos committed May 12, 2023
1 parent af387de commit 39cc093
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion subsys/bluetooth/controller/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ config BT_CTLR_SDC_PAWR_ADV
if BT_CTLR_SDC_PAWR_ADV
config BT_CTLR_SDC_PAWR_ADV_COUNT
int "Periodic Advertising with Responses - Advertiser sets"
range 0 10
range 0 BT_EXT_ADV_MAX_ADV_SET
default 1
help
Maximum number of concurrent Periodic Advertising with Responses
Expand Down
7 changes: 6 additions & 1 deletion subsys/bluetooth/controller/hci_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ BUILD_ASSERT(!IS_ENABLED(CONFIG_BT_PERIPHERAL) ||
#endif

#if defined(CONFIG_BT_PER_ADV)
#define SDC_PERIODIC_ADV_COUNT CONFIG_BT_EXT_ADV_MAX_ADV_SET
#if defined(CONFIG_BT_CTLR_SDC_PAWR_ADV)
#define SDC_PERIODIC_ADV_COUNT \
(CONFIG_BT_EXT_ADV_MAX_ADV_SET - CONFIG_BT_CTLR_SDC_PAWR_ADV_COUNT)
#else
#define SDC_PERIODIC_ADV_COUNT CONFIG_BT_EXT_ADV_MAX_ADV_SET
#endif
#define SDC_PERIODIC_ADV_MEM_SIZE \
(SDC_PERIODIC_ADV_COUNT * \
SDC_MEM_PER_PERIODIC_ADV_SET(CONFIG_BT_CTLR_ADV_DATA_LEN_MAX))
Expand Down

0 comments on commit 39cc093

Please sign in to comment.