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

Advertising issue

Hi I am porting my application from SDK12.3 to SDK15.3.

I am facing error during advertising. Below is the code snippet and error is invalid param (0x07).

static void advertising_init(void)
{
    ret_code_t             err_code;
    ble_advertising_init_t init;
    
    m_adv_uuids[0].uuid = 0x0100;
    m_adv_uuids[0].type = BLE_UUID_TYPE_VENDOR_BEGIN;

    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_GENERAL_DISC_MODE;
    init.advdata.uuids_complete.uuid_cnt = 0;
    init.advdata.uuids_complete.p_uuids  = NULL;

    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.srdata.name_type               = BLE_ADVDATA_FULL_NAME;
    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.evt_handler = on_adv_evt;

    err_code = ble_advertising_init(&m_advertising, &init);
    APP_ERROR_CHECK(err_code); //error check fails due to error NRF_ERROR_INVALID_PARAM
 
    ble_advertising_conn_cfg_tag_set(&m_advertising, APP_BLE_CONN_CFG_TAG);
}

For scan response below check fails

static ret_code_t uuid_list_encode(const ble_advdata_uuid_list_t * p_uuid_list,
                                   uint8_t                         adv_type_16,
                                   uint8_t                         adv_type_128,
                                   uint8_t                       * p_encoded_data,
                                   uint16_t                      * p_offset,
                                   uint16_t                        max_size)
{
    ret_code_t err_code;

    // Encode 16 bit UUIDs. check fails
    err_code = uuid_list_sized_encode(p_uuid_list,
                                      adv_type_16,
                                      sizeof(uint16_le_t),
                                      p_encoded_data,
                                      p_offset,
                                      max_size);
    VERIFY_SUCCESS(err_code);

Please let me know if I am missing any configuration setting. I tried to flash ancs service example but device is not getting listed during discovery.

Please help. 

Related