Hello,
I am developping an application based on PAwR (Periodic Advertsing with response) in coded PHY (S8) extended advertising on SDK 2.7.0.
costum chip nrf52840 (on Fanstel BT840F)
My code is based on the Nordic demo :
I am not able to send a payload greater than 55 bytes in the response slot,
I am getting an error with the function responsible of sending data (in the recv_cb) :
err = bt_le_per_adv_set_response_data(current_sync, &rsp_params, &rsp_buf);
bt_hci_core: opcode 0x2083 status 0x45
beacon: recv_cb: Failed to send response (err -5)
The buffer was initialised as the following :
NET_BUF_SIMPLE_DEFINE_STATIC(rsp_buf, 247);
static uint8_t buffer[60] = {0x00};
but when the buffer is set to buffer[55], it works fine.
Here is the configs related to the PAwR :
CONFIG_BT=y CONFIG_BT_BROADCASTER=y CONFIG_BT_EXT_ADV=y CONFIG_BT_PER_ADV=y CONFIG_BT_DEVICE_NAME="PAwR adv sample" CONFIG_BT_MAX_CONN=1 CONFIG_BT_CENTRAL=y CONFIG_BT_PER_ADV_SYNC_TRANSFER_SENDER=y # This example requires more workqueue stack CONFIG_MAIN_STACK_SIZE=2304 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_BT_RX_STACK_SIZE=2048 CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=191
Here are the PAwR timing parameters:
static const struct bt_le_per_adv_param per_adv_params = { .interval_min = 4800, //4800 6s, .interval_max = 4800, //4800 6s, .options = 0, .num_subevents = 20, .subevent_interval = 240, //240 = 300ms .response_slot_delay = 5, // 6.25 ms = 5*1.25 .response_slot_spacing = 150, //150= 18.75ms .num_response_slots = 15, };
We can read in the specifications that the size of the payload can be up to 255 bytes in extended advertising mode (and even more via packet chaining.
and the kconfig show the following :
config BT_CTLR_ADV_DATA_LEN_MAX
int "Maximum Advertising Data Length"
depends on BT_BROADCASTER
range 31 191 if BT_LL_SW_SPLIT && !BT_CTLR_ADV_DATA_CHAIN
range 31 1650
help
Maximum Extended Advertising Data Length.
Thanks in advance for your assistance,
Regards,
Yanis