When BLE_ADV_EXTENDED_ENABLED = true, ble_advertising_start fails.

Hi, it's me, once again. Thankfully the last problem I had was actually my fault... I got distracted and didn't notice a small implementation detail... anyway... Here's today's problem!


I'm trying to enable extended advertising. To do so, I'm just setting `init.config.ble_adv_extended_enabled = true` before calling `ble_advertising_init` (which by the way returns `NRF_SUCCESS`. But when I call `ble_advertising_start`, it fails at the end when it calls the softdevice, `sd_ble_gap_adv_set_configure` with errno = 7 (NRF_ERROR_INVALID_PARAM).


So, what exactly is happening? NRF_ERROR_INVALID_PARAM does not help at all, I mean, the comments at `ble_adv_modes_config_t` don't actually explain anything about what to do when enabling `ble_adv_extended_enabled`, and I didn't find any documentation on it... Automatic docs generated from comments is rarely useful... I've already read what the comment is in the code, I want to know what the flags's effects are and etc... anyway...

All I need to do to make everything work again is set the flag to false... Why does this flag make the softdevice return me `NRF_ERROR_INVALID_PARAM`?

By the way, as I've seen in (https://devzone.nordicsemi.com/f/nordic-q-a/90224/sd_ble_gap_adv_set_configure-returns-nrf_error_invalid_param), it seems that when using `ble_adv_extended_enabled = true`, you must set `flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE.` instead of `BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE`, but that doesn't make any difference to me. Whether it's one flag or the other, if extended mode is *enabled* it doesn't work.

TLDR: if `ble_adv_extended_enabled = true`, I get an errno 7 in this function call at `ble_advertising_start`.

Related