I am creating software for a proof-of-concept device using the nRF52840 Dev Kit and nRF Connect for VS Code.
I started a few weeks ago with the Nordic UART Service code example (for Zephyr).
Recently I found an example here...
https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/getting-started/posts/ncs-ble-tutorial-part-1-custom-service-in-peripheral-role#h55sk6jeuj5h1q0t9y3471sju120rfsj
There are some notable differences, which may be related when these examples were created.
1) NUS calls "bt_enable" with NULL for a parameter, then completes configuration and service initialization after the function returns.
The "custom service" example, calls "bt_enable" with a callback; the code in the callback completes configuration and service initialization.
My initial code follows the NUS example. Since my device will not operate without Bluetooth, there is nothing else to do until configuration has completed.
Should I change the code to use the callback or my I continue to do configuration "synchronously"?
2) The NUS example calls "settings_load" to complete configuration; the "custom service" example does not.
I'm not sure what this does or why it is needed. Would you please explain?
3) A couple of years ago, I worked on a BLE project using the nrf libraries. I believe the library had a limit to the number of services and characteristic which could be supported (maybe a total of 7 or 8 services and characteristics). Is there a similar limitation if I build my new device using nRF Connect and Zephyr libraries?
4) Is there a newer example for developing a custom Bluetooth service?
Thank you,
-Craig Goldman