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

Extended Advertising on NRF52832

Hi

Using SD Version 6.1.1 and NRF Version 15.3.0.

Using the following advertising params I can set non-extended advertising

ble_gap_adv_params_t advertisingParameters;

advertisingParameters.properties.type = BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED; // GAP Advertising type

using  

sd_ble_gap_adv_set_configure(&m_adv_handle, &m_adv_data, &advertisingParams);

As soon I change to

advertisingParameters.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED

I get an error NRF_ERROR_INVALID_PARAM from the Softdevice is there a step I am missing here to use Bluetooth 5

Parents
  • There's more to the initialization function. More specifically you are probably calling sd_ble_gap_adv_set_configure() in the end to configure the advertising paramters.

    Anyways, here's an example I tested with here, and is working with extended advertising:

    static void extended_adv_init(void)
    {
        memset(&m_adv_params, 0, sizeof(m_adv_params));
        //m_adv_params.properties.type = BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED;
        m_adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED;
        m_adv_params.p_peer_addr     = NULL;
        m_adv_params.duration        = BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED;
        m_adv_params.interval      = 0x40;
        m_adv_params.primary_phy   = BLE_GAP_PHY_AUTO;
        m_adv_params.secondary_phy   = BLE_GAP_PHY_AUTO;
        m_adv_params.set_id         = 4;
        m_adv_params.filter_policy = BLE_GAP_ADV_FP_ANY;
    }
    
    static void advertising_init(void)
    {
        ret_code_t               err_code;
        ble_advdata_t            advdata;
        ble_advdata_manuf_data_t manuf_data;
    
        memset(&advdata, 0, sizeof(advdata));
    
        manuf_data.company_identifier = COMPANY_IDENTIFIER;
        manuf_data.data.size          = ADV_ADDL_MANUF_DATA_LEN;
        manuf_data.data.p_data        = m_addl_adv_manuf_data;
    
        advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
        advdata.p_manuf_specific_data = &manuf_data;
    
        err_code = ble_advdata_encode(&advdata, m_adv_data.adv_data.p_data, &m_adv_data.adv_data.len);
        APP_ERROR_CHECK(err_code);
    
        err_code = sd_ble_gap_adv_set_configure(&m_adv_handle, &m_adv_data, &m_adv_params);
        APP_ERROR_CHECK(err_code);
    }

Reply
  • There's more to the initialization function. More specifically you are probably calling sd_ble_gap_adv_set_configure() in the end to configure the advertising paramters.

    Anyways, here's an example I tested with here, and is working with extended advertising:

    static void extended_adv_init(void)
    {
        memset(&m_adv_params, 0, sizeof(m_adv_params));
        //m_adv_params.properties.type = BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED;
        m_adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED;
        m_adv_params.p_peer_addr     = NULL;
        m_adv_params.duration        = BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED;
        m_adv_params.interval      = 0x40;
        m_adv_params.primary_phy   = BLE_GAP_PHY_AUTO;
        m_adv_params.secondary_phy   = BLE_GAP_PHY_AUTO;
        m_adv_params.set_id         = 4;
        m_adv_params.filter_policy = BLE_GAP_ADV_FP_ANY;
    }
    
    static void advertising_init(void)
    {
        ret_code_t               err_code;
        ble_advdata_t            advdata;
        ble_advdata_manuf_data_t manuf_data;
    
        memset(&advdata, 0, sizeof(advdata));
    
        manuf_data.company_identifier = COMPANY_IDENTIFIER;
        manuf_data.data.size          = ADV_ADDL_MANUF_DATA_LEN;
        manuf_data.data.p_data        = m_addl_adv_manuf_data;
    
        advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
        advdata.p_manuf_specific_data = &manuf_data;
    
        err_code = ble_advdata_encode(&advdata, m_adv_data.adv_data.p_data, &m_adv_data.adv_data.len);
        APP_ERROR_CHECK(err_code);
    
        err_code = sd_ble_gap_adv_set_configure(&m_adv_handle, &m_adv_data, &m_adv_params);
        APP_ERROR_CHECK(err_code);
    }

Children
No Data
Related