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

NRF 52840 long range demo modification, ble_advertising_advdata_update function

Hello. I am using and modifying long range demo master from Nordic PlayGround, which was originally developed in sdk 15.0.0. My purpose is to change it so that it will dynamically change and send time stamps in terms of advertisements. Looking thorough different threads here, I found out I will be able to do that with function ble_advertising_adv_data_update function which I think from Advertising module? 

So, I really don't want to migrate the whole program into 15.2 it seems very tedious and I am facing a lot of problems. Instead, I would like to go and take the written function or library from 15.2 and put it in 15.0.0.

I would like to if it is feasible and if so, which source file I should check out?

If there is other walk around for dynamically changing advertisement data? I would love to know/

Thank you in advance.

  • Hello,

    The most straightforward approach is to stop the advertiser, update payload, then restart advertising with the updated set. The additional CPU processing overhead of doing this should be minimal. What makes on-the-fly updates of the advertising payload a bit difficult/messy in this release is that the application must provide a new advertising buffer when calling sd_ble_gap_adv_set_configure() while the advertisement module only provides one. In other words, that buffer needs to come from the application.

    This was improved in SDK 16. From the release notes: 

    Advertising Module: improved dynamic advertising data update, no additional buffer
    is needed now - swap buffer was introduced within the module implementation.

    So you may consider importing the entire advertisement module from SDK 16.0.0. Some porting may be required. 

Related