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

Add CAF BLE advertisement definition path

Hi,

I am using the CAF BLE components to use bluetooth on the nRF52840, which I control over HCI via the nRF9160. This is all working.

To use the CAF advertising component I have to set the path to ble advertisement data definition by defining the symbol CONFIG_CAF_BLE_ADV_DEF_PATH in prj.conf.

I set it as follows:

CONFIG_CAF_BLE_ADV_DEF_PATH="ble_adv_def.h"

Then in CMakeLists.txt, I include the folder src/configuration that contains ble_adv_def.h:

# Include application event headers
zephyr_library_include_directories(
	src/events
	src/configuration
	)

Using this method I am getting 'No such file or directory' when compiling ble_adv.c, which includes the header file:

https://github.com/nrfconnect/sdk-nrf/blob/11fb11eb1cbda80e9a83806e5f5499f8ce6a2cc6/subsys/caf/modules/ble_adv.c#L35

When defining the absolute path to ble_adv_def.h in CONFIG_CAF_BLE_ADV_DEF_PATH the compilation works fine. What am I doing wrong?

Kind regards, Stefan

Related