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

  • Michael did you get this example working? I am also struggling to compile on the SDK 15.3 and would appreciate a long range example that works on this SDK.

  • Hi Jacky

    Sorry for the late reply, but I have been on holiday

    I think I did get communication going in the end, but was unable to actually confirm if the 'long range' was actually working correctly..... I need to pick this project up again in the near future as I have been doing something else of late.

    Sorry if I cant help more than that..... the documentation for the long range mode enablement isn't the best from Nordic - I wish they would improve it so that people can self service their own problems without having to make bad assumptions or guesses.

    Cheers

    Michael

  • Hi @Michael,

     According to the code, may I know why there is a memset (line 12) to clear the adv_params before it start advertising?

    Im a bit confuse as the adv_params already set in advertising_init, then comes to advertising_start it was clear and set again?

    Because I'm facing the same problem as you , so I wondering why it is so. 

    Hope u can help. Thank you so much .

    Regards,

    Kathleen

  • Hi ,

    I have similar problem face while using BLE_GAP_PHY_CODED just to do simple advertising. (using nRF5_SDK_15.3.0_59ac345)

    The code I compiled can run well without error, however the nrf52840 PDK didn't advertising as my sniffer can't get any advertise packet . I double check with the oscilloscope, the scope display show no advertise packet.  

    I set the .scan_rsp_data.p_data = NULL and .scan_rsp_data.len=0 . however still no advertise packet was advertise. 

    I wonder how it could happen. Can you help?

    Thank you .

    Best regards,

    Kathleen

Related