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

How to enable Bluetooth 5 Extended Advertisement?

Hi all,

I'm trying to enable Bluetooth 5 extended advertisement in nRF52840.

Currently, I'm using Nordic SDK v15.0.0 and S140 Softdevice v6.0.0.

In order to init the advertising, I call sd_ble_gap_adv_set_configure with the following parameters:

    ret_code_t err_code;

    // Initialize advertising parameters (used when starting advertising).
    memset(&m_adv_params, 0, sizeof(m_adv_params));

    m_adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED;
    m_adv_params.p_peer_addr     = NULL;    			// Undirected advertisement.
    m_adv_params.filter_policy   = BLE_GAP_ADV_FP_ANY;
    m_adv_params.interval        = NON_CONNECTABLE_ADV_INTERVAL;
    m_adv_params.duration        = 0;       			// Never time out.
    m_adv_params.primary_phy 	 = BLE_GAP_PHY_CODED;	// [MOTAM] Long range codification
    m_adv_params.secondary_phy 	 = BLE_GAP_PHY_CODED;	// [MOTAM] Long range codification

    uint8_t frame [] = 	{
    						0x1E, 0x16, 0xBE, 0xDE, 0xA9,
    						0x16, 0xBE, 0xDE, 0xA9, 0x16,
							0xBE, 0xDE, 0xA9, 0x16, 0xBE,
							0xDE, 0xA9, 0x16, 0xBE, 0xDE,
							0xA9, 0x22, 0x32, 0x24, 0x25,
							0x26, 0x27, 0x28, 0x29, 0x30,
							0x31
    					};
    					
    memcpy (m_adv_data.adv_data.p_data, frame, sizeof(frame));
    m_adv_data.adv_data.len = sizeof(frame);

    err_code = sd_ble_gap_adv_set_configure(&m_adv_handle, &m_adv_data, &m_adv_params);
    APP_ERROR_CHECK(err_code);

And this works. But when I try to send a longer frame (more than 31 bytes), the code crash.

I read that not all the Bluetooth 5 functionalities is working in this version. Are there any solution for this issue?

Thanks in advance,

Manuel

Parents Reply Children
No Data
Related