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

Updating Advertising Data in SDK15

I would like to update my advertising data on the fly but actually it doesn't work. Many many posts talk about this behaviour, but no working answers.

Before SDK15, we use ble_advdata_set to changing the advertising data, so simple so easy work.

All of them suggest to use ble_advdata_encode and sd_ble_gap_adv_set_configure, but they returns error.

Please do not provide with other thread's link, because I have reviewed most of them. Also, I tired the the code in the example ble_app_beacon which includes codes for updating beacon's advertising data, but it ends up with failure.

Most of the advised code more or less like the following :

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
static ble_gap_adv_params_t m_adv_params; /**< Parameters to be passed to the stack when starting advertising. */
static uint8_t m_adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET /**< Advertising handle used to identify an advertising set. */
/**@brief Struct that contains pointers to the encoded advertising data. */
static ble_gap_adv_data_t m_adv_data =
{
.adv_data =
{
.p_data = m_enc_advdata,
.len = BLE_GAP_ADV_SET_DATA_SIZE_MAX
},
.scan_rsp_data =
{
.p_data = NULL,
.len = 0
}
};
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

After so many threads, views, etc., still not getting the right solution ! Just want to ask from Nordic, why you removed the API "ble_advdata_set" ?