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

Advertising Interval

Hi,

I am facing an issue when setting up advertising intervals (in connectable mode).

Whatever the value I enter I will always end up with an advertising interval of about 187ms.

Here is the code I use:

#define APP_ADV_INTERVAL                    MSEC_TO_UNITS(1000, UNIT_0_625_MS) 

(...)

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; //BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;

    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.config.ble_adv_fast_enabled  = true;
    init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
    init.evt_handler = NULL;

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

void advertising_start(void)
{
    uint32_t err_code = ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);
}

When I chek for the interval value which is set just before sd_ble_gap_adv_start I get the right value (the one I defined)

But still Advertising interval will remain 187ms..

NRF_LOG_INFO(p_advertising->adv_params.interval);
ret = sd_ble_gap_adv_start(p_advertising->adv_handle, p_advertising->conn_cfg_tag);

Any ideas?

Thanks!

Related