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

ble_advertising_init() and ble_advertising_start()

I've just noticed that it's possible to call ble_advertising_init() and ble_advertising_start() with params that are quite conflicting.

ble_adv_modes_config_t advertising_modes_config =
{
	...
	.ble_adv_directed_enabled = false,
	.ble_adv_directed_slow_enabled = false,
	...
	.ble_adv_fast_enabled = true,
	...
	.ble_adv_slow_enabled = false,
	...
};

err_code = ble_advertising_init(&advdata, NULL, &advertising_modes_config, on_adv_evt, NULL);
APP_ERROR_CHECK(err_code);

err_code = ble_advertising_start(BLE_ADV_MODE_DIRECTED);
APP_ERROR_CHECK(err_code);

The header for ble_advertising_start() says:

You can start advertising in any of the advertising modes that you enabled during initialization.

But I haven't enabled directed advertising at init and yet I'm able to start in that mode. Is this a bug and what will the behaviour be?

Parents Reply Children
No Data
Related