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

long range

Hello All,

I am having trouble changing the 'ble_app_multiperipheral_pca1056_s140' example to work with long range. I have read a few of the blog posts and similar devzone posts but I can't seem to find an answer that works. 

Here is my code for configuring the gap advertising set:

   // only extended advertising will allow primary phy to be coded
    NRF_LOG_INFO("Advertising type set to EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED ");
    //adv_params.properties.type = BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED;
    adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED;
              
    err_code = ble_advdata_encode(&advdata, m_adv_data.adv_data.p_data, &m_adv_data.adv_data.len);
    APP_ERROR_CHECK(err_code);

    // Start advertising.
    memset(&adv_params, 0, sizeof(adv_params));
    adv_params.p_peer_addr   = NULL;
    adv_params.filter_policy = BLE_GAP_ADV_FP_ANY;
    adv_params.interval      = APP_ADV_INTERVAL;
    adv_params.duration      = 0;//APP_ADV_DURATION;

    NRF_LOG_INFO("Setting adv params phy to coded phy .. ");
    adv_params.primary_phy     = BLE_GAP_PHY_CODED;
    //adv_params.secondary_phy   = BLE_GAP_PHY_CODED;

    err_code = sd_ble_gap_adv_set_configure(&m_adv_handle, &m_adv_data, &adv_params);
    APP_ERROR_CHECK(err_code);
}

The error I get is :

<info> app: Setting adv params phy to coded phy ..

<error> app: ERROR 7 [NRF_ERROR_INVALID_PARAM] at :0

PC at: 0x00000000

<error> app: End of error report

Any help where I am going wrong or anything that I have missed would really be appreciated.

Cheers

Michael

8ball

Related