Cannot scan extended adv for packets > legacy length in zephyr

I'm trying to send and receive an extended advertisement packet with about 100bytes of payload.

I started with the sample extended_adv example.

I 1st validated that using 2 nrf52840 boards I could send and receieve extended adv data.

I then modified the sender to send more data:

I added "CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=191" to prj.conf

and increased the packet size in main.c:

static struct bt_data ad[] = {

        BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1),

        BT_DATA(BT_DATA_SVC_DATA16, NULL, 0)

};

...

        static uint8_t data[30];

        for (int i = 0; i < sizeof(data); i++)

                data[i] = i;

        ad[1].data_len = sizeof(data);

        ad[1].data = data;

Using nrfconnect on my phone, I can see the extended packets being sent by the advertiser with the extended data in the Service Data field

However, the scanner sample cannot see the longer extended packets.

I tried increasing the scan buffer size with 

CONFIG_BT_EXT_SCAN_BUF_SIZE=1600

but it had no effect.

I see the same issue in my application, but figured I'd keep it simple with the example

I'm using zephyr 3.7.0. my main application is already on zephyr 3.7, so it would be a large effor to mirgate to the nordic 2.7 SDK if that is needed.

Parents
  • Hello,

    It should work if you add CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 to your prj.conf file in your scanner project. This setting defaults to 31.

    Best regards,

    Vidar

    EDIT: fixed a typo

  • Thank you.  you had a typo, the switch is 'CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX' but adding this did indeed resolve my issue.  I really wish there were better documentation or clearer examples of some of these bluetooth parameters.  I find discoverability to be realy challenging.

  • Thanks for confirming that it worked and sorry about the typo. My typical approach to discovering relevant Kconfig configurations is to go through the Kconfig symbols defined for specific module or library I'm working with. For example, the Kconfig files here link if you are looking for configurations related to the Bluetooth host.

  • Hello,

    I am using Nordic SDK v2.9.1 with nrf52840dk and need also extended scanning with longer data. When adding  CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 to the same Scanner sample, I get this:

    warning: BT_CTLR_SCAN_DATA_LEN_MAX (defined at subsys/bluetooth/controller/Kconfig.ll_sw_split:212)
    was assigned the value '191' but got the value ''. Check these unsatisfied dependencies:
    BT_LL_SW_SPLIT (=n).

    When I set experimental  CONFIG_BT_LL_SW_SPLIT=y, then linking ends up to the undefined reference to `__device_dts_ord_134'.

    Should I do something different with newer SDK ?

Reply
  • Hello,

    I am using Nordic SDK v2.9.1 with nrf52840dk and need also extended scanning with longer data. When adding  CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 to the same Scanner sample, I get this:

    warning: BT_CTLR_SCAN_DATA_LEN_MAX (defined at subsys/bluetooth/controller/Kconfig.ll_sw_split:212)
    was assigned the value '191' but got the value ''. Check these unsatisfied dependencies:
    BT_LL_SW_SPLIT (=n).

    When I set experimental  CONFIG_BT_LL_SW_SPLIT=y, then linking ends up to the undefined reference to `__device_dts_ord_134'.

    Should I do something different with newer SDK ?

Children