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

Starting connectable advertiser in Mesh Example 2.0.0

Hi @ll,

I'm using Mesh SDK 2.0.0 with SD 6.0.0.

The example everything is based on is the dfu-example (including parts of the beaconing example)

I'm now trying to add a connectable advertiser to communicate using GATT (not within the mesh, so no GATT-Proxy).

I finally managed to include all parts that are necessary for the connectable advertiser and it's also starting but I can not find it during scanning using nRF Connect for Mobile.

The advertising parts I took from SDK15.0.0 example ble_app_uart, here is the relevant part of the main function:

int main(void)
{
    initialize();
    gap_params_init();
    gatt_init();
    advertising_init();
    conn_params_init();
    advertising_start();
    execution_start(start);

    for (;;)
    {
        (void)sd_app_evt_wait();
    }
}

The strange par tis that starting the advertiser is only working in SLOW-mode, not in FAST-mode.

err_code = ble_advertising_start(&m_advertising, BLE_ADV_MODE_SLOW); <-- is "working" as it returns error_code 0

err_code = ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST); <-- returns the error NRF_ERROR_NOT_FOUND

advertising_init also succeeds with the following code:

static void advertising_init(void)
{

    uint32_t               err_code;
    ble_advertising_init_t init;

    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.srdata.uuids_complete.uuid_cnt = 0;//sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    init.srdata.uuids_complete.p_uuids  = NULL;//m_adv_uuids;

    init.config.ble_adv_fast_enabled  = true;
    init.config.ble_adv_fast_interval = 1600;
    init.config.ble_adv_fast_timeout  = 0;
    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);
}

So my question: Why do I not see any device advertising with the set name? Even if I filter by name using nRF Connect for mobile?

Thank you in advance for your help!

Bye
Andrej

Related