nRF5 SDK is not maintained anymore
More Info: Consider nRF Connect SDK for new designs
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

Define a BLE service instance on the header file

Hi, 

I'm currently development firmware for a application using a Nordic chip. This application will use some drivers allowing the communication with sensors and for the transmission of the sensor data I will use the BLE. So this application is expected to use 4 BLE services, but right now I only have implemented 3 (BAS, NUS and LLS). For the Battery and Nordic UART Service, I have define the each instance on a header file and everything work as expected. When I implement the Link Loss Service, I have done the same thing (define service macro on the header file) but, for some reason, I can't connect to the BLE. When I define the Link Loss Service instance on the .c file, the BLE work perfectly with the 3 Services. 

There is something special with the Link Loss Service that restrict the instance definition to the .c file?

Thanks in advance!

Parents Reply
  • Hi! Thanks for your reply!

    This first 2 images are basically the same but with Battery Service implemented.

    When I define the Link Loss Service instance on the .h file and I try to connect, the code blocks at this point. Even if a try connect again, nothing happen.

    This second image is when a define the Link Loss Service instance on the .c file.

    On this last 2 images, only the Link Loss Service is implemented. The first one is when the service instance is declared on the .h file

    Only with the Link Loss Service and the instance being declare on the .c file.

Children
Related