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

Difficulties with BLE_ADV_EVT_SLOW occurring.

I am not seeing a transition to BLE_ADV_EVT_SLOW.  The transition I see goes from FAST to idle, without a transition to slow, from the configuration I don't expect to be in IDLE.

init.config.ble_adv_fast_enabled = true;
init.config.ble_adv_fast_interval = app_data.advfast_interval;
init.config.ble_adv_fast_timeout = app_data.advfast_timeout;

init.config.ble_adv_slow_enabled = true;
init.config.ble_adv_slow_interval = app_data.advslow_interval;
init.config.ble_adv_slow_timeout = 0;

err_code = ble_advertising_init(&m_advertising, &init);
APP_ERROR_CHECK(err_code);

Have placed some debug logs to see the transitions:


static void on_adv_evt(ble_adv_evt_t ble_adv_evt)
{
  switch (ble_adv_evt)
  { 
    case BLE_ADV_EVT_FAST:
    NRF_LOG_INFO( "BLE_ADV_EVT_FAST:" );
    LEDS( if( m_led_on ) bsp_board_led_on(ADVERTISING_LED) );
    break;

    case BLE_ADV_EVT_SLOW:
      NRF_LOG_INFO( "BLE_ADV_EVT_SLOW:" );
      break;

    case BLE_ADV_EVT_IDLE:
      NRF_LOG_INFO( "BLE_ADV_EVT_IDLE:" );
      advertising_start( false );
      break;

    default:
    break;
  }

}

The log output I receive show:

<info> app: BLE_ADV_EVT_FAST:
<info> app: BLE_ADV_EVT_IDLE:
<info> app: BLE_ADV_EVT_FAST:
<info> app: BLE_ADV_EVT_IDLE:
<info> app: BLE_ADV_EVT_FAST:
<info> app: BLE_ADV_EVT_IDLE:
<info> app: BLE_ADV_EVT_FAST:
<info> app: BLE_ADV_EVT_IDLE:
<info> app: BLE_ADV_EVT_FAST:
<info> app: BLE_ADV_EVT_IDLE:
<info> app: BLE_ADV_EVT_FAST:

This is with a S140 release of the SDK.

Related