Hi
With the release of softdevice S140 v6.0.0, the advertising API has changed to incorporate the concept of Advertising Set that was introduced in Bluetooth Core Specification v5.0. As a result, the functions sd_ble_gap_adv_set_configure()
and sd_ble_gap_adv_start()
must both be called in order to advertise, whereas in previous versions of the softdevice, only sd_ble_gap_adv_start()
was needed.
My questions is, what do we need to do to our pre-existing app to replicate the behaviour we got on previous softdevices (e.g. softdevce v6.0.0-alpha.6). Specifically, for sd_ble_gap_adv_set_configure(),
what must we set the advertising data to in order to be able to start sending out connectable and scannable adverts? We have tried setting that to NULL but we are getting the error NRF_ERROR_NOT_FOUND
.
This is our pseudo-code:-
ble_gap_adv_params_t adv_params;
ble_gap_adv_data_t * p_adv_data;
uint8_t m_adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET;
p_adv_data = NULL;
memset(&adv_params, 0, sizeof(adv_params));
adv_params.properties.type = BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED;
adv_params.properties.anonymous = 0;
adv_params.properties.include_tx_power = 0;
adv_params.p_peer_addr = NULL; // Undirected advertisement.
adv_params.filter_policy = BLE_GAP_ADV_FP_ANY;
adv_params.interval = BLE_GAP_ADV_INTERVAL_MAX;
adv_params.duration = 0;
nrfErr = sd_ble_gap_adv_set_configure(&m_adv_handle, p_adv_data, &adv_params);
nrfErr = sd_ble_gap_adv_start(m_adv_handle, BLE_CONN_CFG_TAG_DEFAULT);
We are using softdevice S140 v6.0.0 and SDK v15.0.0 on an nRF52840 PDK.
Thanks
Youssif