Hi All,
I want explore BLE5 extended advertisement with nRF52832.
Using "ble_peripheral\ble_app_blinky" code from SDK16.0.0, facing "NRF_ERROR_INVALID_PARAM(7)" error in response to sd_ble_gap_adv_set_configure. Following is a source code of advertisement initialization.
Please draw my attention where I am making mistake.
#define ADV_MFG_DATA_SIZE 10
uint8_t gu8ar_mfg_adv_data[ADV_MFG_DATA_SIZE] = {0};
static void advertising_init(void)
{
ret_code_t err_code;
ble_advdata_t advdata;
ble_advdata_t srdata;
ble_uuid_t adv_uuids[] = {{LBS_UUID_SERVICE, m_lbs.uuid_type}};
// Build and set advertising data.
memset(&advdata, 0, sizeof(advdata));
advdata.name_type = BLE_ADVDATA_FULL_NAME;
advdata.include_appearance = true;
advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
//-----------------------------------------------------------------------------
ble_advdata_manuf_data_t manuf_data;
for(uint8_t i=0;i<ADV_MFG_DATA_SIZE;i++) gu8ar_mfg_adv_data[i]=i+1;
manuf_data.company_identifier = 0x0437;
manuf_data.data.size = sizeof(gu8ar_mfg_adv_data);
manuf_data.data.p_data = gu8ar_mfg_adv_data;
advdata.p_manuf_specific_data = &manuf_data;
//-----------------------------------------------------------------------------
memset(&srdata, 0, sizeof(srdata));
srdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
srdata.uuids_complete.p_uuids = adv_uuids;
err_code = ble_advdata_encode(&advdata, m_adv_data.adv_data.p_data, &m_adv_data.adv_data.len);
APP_ERROR_CHECK(err_code);
err_code = ble_advdata_encode(&srdata, m_adv_data.scan_rsp_data.p_data, &m_adv_data.scan_rsp_data.len);
APP_ERROR_CHECK(err_code);
ble_gap_adv_params_t adv_params;
// Set advertising parameters.
memset(&adv_params, 0, sizeof(adv_params));
adv_params.primary_phy = BLE_GAP_PHY_AUTO;
adv_params.secondary_phy = BLE_GAP_PHY_AUTO;
adv_params.duration = APP_ADV_DURATION;
adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED;
adv_params.p_peer_addr = NULL;
adv_params.filter_policy = BLE_GAP_ADV_FP_ANY;
adv_params.set_id = 4;
adv_params.interval = APP_ADV_INTERVAL;
err_code = sd_ble_gap_adv_set_configure(&m_adv_handle, &m_adv_data, &adv_params);
APP_ERROR_CHECK(err_code);
}