This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Custom Service Define Macro "has no type or storage class"

Hello,

I tried building the app showcased in this example:

https://www.novelbits.io/smart-ble-lightbulb-application-nrf52/

I have gotten everything to build fine except for the definition macro.

I defined it as (as the example does) (in led_service.h):

#define BLE_LED_SERVICE_DEF(_name)                                                                          \
  static ble_led_service_t _name;                                                                             \
  NRF_SDH_BLE_OBSERVER(_name ## _obs,                                                                         \
                       BLE_LED_SERVICE_BLE_OBSERVER_PRIO,                                                     \
                       ble_led_service_on_ble_evt, &_name)

In my main.c file I call it as:

BlE_LED_SERVICE_DEF(m_led_service);

However, when I built the project, I get the following errors:

It gives a warning about the macro call, and then complains that it hasn't been defined.

Why does this happen and how could I solve it?

Best regards,

Ernesto

Related