Added ble_radio_notification files to my project in SDK11, but they wont compile.
Added ble_radio_notification files to my project in SDK11, but they wont compile.
Most of the bugs are fixed in SDK12, but you still need to include nrf_nvic.h:
#include "nrf_nvic.h"
This is a bug in the ble_radio_notification files. Sd_nvic_ functions have been moved to nrf_nvic.h, so include this in ble_radio_notification.h.
nrf_radio_notification_distance_t is no longer defined. Change to uint8_t instead (used by sd_radio_notification_cfg_set).
Here are the fixed files:
ble_radio_notification.c
ble_radio_notification.h
If you're trying to search through the code, it looks like sd_radio_notification_cfg_set
uses enum NRF_RADIO_NOTIFICATION_DISTANCES
. You can also use this enum instead of uint8_t
if you want to make it more clear.
sd_radio_notification_cfg_set()
uses uint8_t, but the values have to be the ones defined in the anonymous enums NRF_RADIO_NOTIFICATION_DISTANCES
and NRF_RADIO_NOTIFICATION_TYPES
. These enums are the same as a defines in practice. The reason sd_radio_notification_cfg_set()
does not take enums as argumenst is that enums can have different sizes depending on compiler options, which may cause issues regarding alignment and backwards compatibility. The application may also be compiled by a different compiler than the SoftDevice which can make it use different sizes for the enums.
This is pertinent to the radio notification tutorial, especially under SDK 11. Changing type to uint8_t was a quick fix. Thanks - RJH
This still has not been fixed in SDK 12.3 which is the last version of the SDK that supports the nRF51xx processors
Is Nordic going to update version 12.3 to fix this or release a 12.4 ?
Just replacing these files in the local copy of the SDK is not a good idea for long term supportability of code, so people would need to add these files to their own project and ignore the version in the SDK