This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Can multiple set_id be set at the same time when using extended broadcast on nRF Connect SDK ?

Hello, All

I saw this description in the Bluetooth 5 Go Faster. Go Further document:

Advertising sets have an ID which is used to indicate which set a given packet belongs to and each set has its own advertising parameters, such as its advertising interval and the PDU type to be used. Advertising sets may use either the primary channels or the secondary channels. Critically, the task of scheduling and transmitting the different sets falls to the Link Layer in the Controller rather than it having to be driven by the Host, which would be far less power efficient. The Host needs only to inform the Controller of the advertising sets and their respective parameters initially, after which the Link Layer takes over.

So,Can I understand that multiple set_ids can be set at the same time, and the link layer can schedule broadcasts according to different set_id broadcast parameters?

If so, how do I need to set it up ?

I tried it, but I made an error when creating the second set_id, or are there any macros that need to be set ?

Finally, I saw this function:

Does this mean that if you need to create a new set_id, you need to delete the already created set_id ?

What should I do ? Are there any examples for reference ?

Or is it not currently possible to set multiple set_ids at the same time to control multiple broadcasts ?

Hope to get your answer soon ... Thank you !

Parents
  • Hi Kenny, 
    Have you tried to increase CONFIG_BT_EXT_ADV_MAX_ADV_SET

    As far as I can tell from the code and from the documentation, multiple adv_set is supported in Zephyr. 

  • Yes, I did, but I still got an error.

    Here is part of my code:

    in main.c:

    void main(void)
    {
        int err = bt_enable(NULL);
        if (err) {
            LOG_ERR("[%04d] Bluetooth init failed (err %d).\n", __LINE__, err);
            return;
        }
        LOG_INF("[%04d] Bluetooth initialized.", __LINE__);
    
        err = bt_le_ext_adv_create(&param, NULL, &adv_set);
        if (err) {
            LOG_ERR("[%04d] Create extended advertising set_id failed (err %d).\n", __LINE__, err);
            return;
        }
    
        err = bt_le_ext_adv_create(&param, NULL, &adv_set_1);
        if (err) {
            LOG_ERR("[%04d] Create extended advertising set_id_1 failed (err %d).\n", __LINE__, err);
            return;
        }
    
        err = bt_le_ext_adv_set_data(adv_set, ad, ARRAY_SIZE(ad), NULL, 0);
        if (err) {
            LOG_ERR("[%04d] Failed to set advertising data (%d).\n", __LINE__, err);
            return;
        }
    
        err = bt_le_ext_adv_set_data(adv_set_1, ad, ARRAY_SIZE(ad), NULL, 0);
        if (err) {
            LOG_ERR("[%04d] Failed to set advertising data (%d).\n", __LINE__, err);
            return;
        }
    
        err = bt_le_ext_adv_start(adv_set, NULL);
        if (err) {
            LOG_ERR("[%04d] Extended advertising failed to start (err %d).\n", __LINE__, err);
            return;
        }
    
        err = bt_le_ext_adv_start(adv_set_1, NULL);
        if (err) {
            LOG_ERR("[%04d] Extended advertising failed to start (err %d).\n", __LINE__, err);
            return;
        }
    
        LOG_INF("[%04d] Extended advertising enable...", __LINE__);
    }
    

    in prj.conf:

    # LOG.
    CONFIG_LOG=y
    CONFIG_USE_SEGGER_RTT=y
    
    # DK library.
    CONFIG_DK_LIBRARY=y
    
    # Bluetooth.
    CONFIG_BT=y
    CONFIG_BT_DEBUG_LOG=y
    CONFIG_BT_BROADCASTER=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME="NCS-adv"
    
    CONFIG_BT_LL_SW_SPLIT=y
    CONFIG_BT_LL_SOFTDEVICE=n
    CONFIG_BT_CTLR=y
    CONFIG_BT_CTLR_CONN_RSSI=y
    CONFIG_BT_CTLR_ADVANCED_FEATURES=y
    CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y
    
    CONFIG_BT_EXT_ADV=y
    CONFIG_BT_PER_ADV=y
    CONFIG_BT_CTLR_ADV_EXT=y
    CONFIG_BT_CTLR_PHY_CODED=y
    
    CONFIG_BT_EXT_ADV_MAX_ADV_SET=2

    And Here is an error message:

  • Hi Kenny, 
    Could you send the whole main.c ? I just want to check if other parameters was fine. 

    Could you also increase CONFIG_BT_MAX_CONN ? 

  • Hi Kenny, 
    I can reproduce the issue here. 
    However, when testing with our Softdevice controller (remove CONFIG_BT_LL_SW_SPLIT=y
    CONFIG_BT_LL_SOFTDEVICE=n ) it worked fine for me. I can see 2 sets of advertising (after modifying set 2 so that it's not identical to set 1) 
    Is there any hard requirement that you need to use Zephyr controller ? 

  • Hi,Hung Bui,

    There is no limit for the time being.

    So this means that currently only your Softdevice controller supports it, and the zephyr controller does not support it, right?

    Thank you very much !

Reply Children
Related