I know this question was raised here a couple of years ago but it seems to me the API was changed since that time. If I set the timeout to 0 and use BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE following last recommendation the advertisement doesn't start.
What puzzles me is this code in ble_advertizing.c (SDK 8.1.1):
uint32_t ble_advertising_init(...)
Line 104:
// If interval or timeout is 0, disable the mode.
if (m_adv_modes_config.ble_adv_fast_interval == 0 || m_adv_modes_config.ble_adv_fast_timeout == 0)
{
m_adv_modes_config.ble_adv_fast_enabled = false;
}
if (m_adv_modes_config.ble_adv_slow_interval == 0 || m_adv_modes_config.ble_adv_slow_timeout == 0)
{
m_adv_modes_config.ble_adv_slow_enabled = false;
}
That basically disables advertisement if timeout is 0 regardless of BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE or BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE.
So how to set no timeout advertisement then? Regards, DSnejko.