How do you know what libraries to add when you decide to use an API function call? The documentation does not show that.
There is actually only one API and that's Nordic BLE stack aka Soft Device (functions have sd_
in their name). In case you use it then simply include ble.h
from folder corresponding to your Soft Device type (e.g. components\softdevice\s132\headers\ble.h
) and you are done. Then all the rest in SDK are rather stand-alone modules (or libraries if you want). There you either know what lib you want to use and how (and then you first find the functions in their header files and then logically include that header file in your project to be able to call that function).
In case that this doesn't answer your problem then please be more specific, e.g. give us an example what are you doing and where you doubt what headers should be included and what source C files should be compiled.
I have actually asked this question in another thread at the same time. I was trying to follow "Bluetooth low energy Advertising, a beginner's tutorial" which is written for SDK11 which failed because I am using SDK14.1. Superpak told me to instead use the ble_app_blinky example. Now, I am trying to use this example with the same tutorial. However, when I try to add a suggested piece of code and build, I get an error complaining about missing declaration for sd_gap_address_set() and missing definition for BLE_GAP_ADDR_CYCLE_MODE_AUTO. Superpak suggested to add the peer_manager library (which unlike what you are saying is not a softdevice library). I included peer_manager.h to main.c and included peer_manager.c under a new folder in the project but I am still getting the same error. I tried to understand this function call from the documentation but found nothing about how to prepare for using it.
I have actually asked this question in another thread at the same time. I was trying to follow "Bluetooth low energy Advertising, a beginner's tutorial" which is written for SDK11 which failed because I am using SDK14.1. Superpak told me to instead use the ble_app_blinky example. Now, I am trying to use this example with the same tutorial. However, when I try to add a suggested piece of code and build, I get an error complaining about missing declaration for sd_gap_address_set() and missing definition for BLE_GAP_ADDR_CYCLE_MODE_AUTO. Superpak suggested to add the peer_manager library (which unlike what you are saying is not a softdevice library). I included peer_manager.h to main.c and included peer_manager.c under a new folder in the project but I am still getting the same error. I tried to understand this function call from the documentation but found nothing about how to prepare for using it.