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

Adding ADV/SCAN_RSP data

HI Nordic,

I am working PCA10040, SDK17.0.2, ble_app_uart routine.

I'm try to add ADV/SCAN_RSP data, but when I add some field, such as p_manuf_specific_data or service_data_count, the board can't run up.

After execution, I found the program generate an error at ble_advdata_encode(ble_advdata.c line 612).

It seems that the program ran out of control.

What's the right way to do this?

static void advertising_init(void)
{
    uint32_t               err_code;
    ble_advertising_init_t init;
    int8_t myarray[6] = {0x02,0x03,0x02,0x01,0x05,0x09};

    memset(&init, 0, sizeof(init));

    init.advdata.name_type          = BLE_ADVDATA_FULL_NAME;
    init.advdata.include_appearance = false;
    init.advdata.flags              = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;
    //init.advdata.p_tx_power_level= myarray;

    init.srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    init.srdata.uuids_complete.p_uuids  = m_adv_uuids;
    //init.srdata.p_tx_power_level = myarray;
    //init.srdata.p_manuf_specific_data->company_identifier = 0x4c;
    init.srdata.service_data_count = 3;

    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);
}

Parents Reply Children
No Data
Related