I'm using the nRF52840 and the nRF5 SDK 17.1.0.
I can enable extended advertising with the following program,
static void advertising_init(void)
{
uint32_t err_code;
ble_advertising_init_t init;
memset(&init, 0, sizeof(init));
uint8_t data_need_adv[200] = {0x26, 0x14, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10
, 0x26, 0x14, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10
, 0x26, 0x14, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10
, 0x26, 0x14, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10
, 0x26, 0x14, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10
, 0x26, 0x14, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10
, 0x26, 0x14, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10
, 0x26, 0x14, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10
, 0x26, 0x14, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10
, 0x26, 0x14, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10
, 0x26, 0x14, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10
, 0x26, 0x14, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10
, 0x26, 0x14, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10
, 0x26, 0x14, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10
, 0x26, 0x14, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10
, 0x26, 0x14, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10
, 0x26, 0x14, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10
, 0x26, 0x14, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10
, 0x26, 0x14, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10
, 0x26, 0x14, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10};
ble_advdata_manuf_data_t my_advdata;
my_advdata.company_identifier = 0x0059;
my_advdata.data.p_data = data_need_adv;
my_advdata.data.size = sizeof(data_need_adv) / sizeof(uint8_t);
init.advdata.p_manuf_specific_data = &my_advdata;
init.advdata.name_type = BLE_ADVDATA_FULL_NAME;
init.advdata.include_appearance = false;
init.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
init.advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
init.advdata.uuids_complete.p_uuids = m_adv_uuids;
init.config.ble_adv_extended_enabled = true;
init.config.ble_adv_fast_enabled = true;
init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
init.config.ble_adv_fast_timeout = APP_ADV_DURATION;
init.evt_handler = on_adv_evt;
err_code = ble_advertising_init(&m_advertising, &init);
APP_ERROR_CHECK(err_code);
ble_advertising_conn_cfg_tag_set(&m_advertising, APP_BLE_CONN_CFG_TAG);
}
but my scanner is unable to scan the extended packets.
I have also made the following modifications, however it still doesn't work.
static void nrf_ble_scan_default_param_set(nrf_ble_scan_t * const p_scan_ctx)
{
// Set the default parameters.
p_scan_ctx->scan_params.active = 0;
#if (NRF_SD_BLE_API_VERSION > 7)
p_scan_ctx->scan_params.interval_us = NRF_BLE_SCAN_SCAN_INTERVAL * UNIT_0_625_MS;
p_scan_ctx->scan_params.window_us = NRF_BLE_SCAN_SCAN_WINDOW * UNIT_0_625_MS;
#else
p_scan_ctx->scan_params.interval = NRF_BLE_SCAN_SCAN_INTERVAL;
p_scan_ctx->scan_params.window = NRF_BLE_SCAN_SCAN_WINDOW;
#endif // #if (NRF_SD_BLE_API_VERSION > 7)
p_scan_ctx->scan_params.timeout = NRF_BLE_SCAN_SCAN_DURATION;
p_scan_ctx->scan_params.filter_policy = BLE_GAP_SCAN_FP_ACCEPT_ALL;
p_scan_ctx->scan_params.scan_phys = BLE_GAP_PHY_1MBPS;
p_scan_ctx->scan_params.extended = 1;
}
Are there any additional settings I need to configure on the scanning side?