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

advertising event when fast advertising ends

    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;

When I use this setup, when the specified duration expires, should I get a BLE_ADV_EVT_IDLE event?  I don't seem to get one, even though I'm testing for it.  SDK 17.0.2 / S140

tatic void on_adv_evt(ble_adv_evt_t ble_adv_evt)
{
    ret_code_t err_code;

    switch (ble_adv_evt)
    {
        case BLE_ADV_EVT_FAST:
            NRF_LOG_INFO("Fast advertising.");
            err_code = bsp_indication_set(BSP_INDICATE_ADVERTISING);
            APP_ERROR_CHECK(err_code);
            break;

        case BLE_ADV_EVT_SLOW:
            NRF_LOG_INFO("Slow advertising.");
            break;

        case BLE_ADV_EVT_IDLE:
            NRF_LOG_INFO("ADV idle mode.");
            sleep_mode_enter();
            break;

        default:
            NRF_LOG_INFO("ADV other event 0x%04x", ble_adv_evt);
            break;
    }
}

Related