Working on an application that can be compiled with BLE functionality turned on or off, I found my "BLE off" configuration failed to compile with the following error while compiling the ble_conn_state.c file:
static assertion failed: "NRF_SDH_BLE_ENABLED not set!"
The problem seems to be that this file checks for NRF_SDH_BLE_ENABLED to be set to 1 in the NRF_SDH_BLE_OBSERVER, showing the above compile time error if it is set to 0. NRF SDK examples that do not use BLE do not have this issue because they do not include this file in the project.
My application is based on the BLE UART (NUS) example, using NUS as an optional remote CLI interface. My current solution is to use a project setting to exclude this file based on the build configuration, but this is not very elegant or consistent with other NRF SDK modules.
What is the best approach to deal with the ble_conn_state file in projects that can be built with or without BLE / NRF_SDH_BLE_OBSERVER?
Is the ble_conn_state.c file missing a check like the folowing?
#if NRF_MODULE_ENABLED(NRF_BLE_CONN_PARAMS)