Hi,
Perhaps this question is too basic, but I haven't been able to find this anywhere.
I've followed this tutorial successfully with an nRF52832 DK: nRF Connect SDK Bluetooth Low Energy tutorial part 1: Custom Service in Peripheral role
However, I'm missing the part about how to implement a peripheral write handler. In other words, how to make writing to a characteristic operate on a uC peripheral; something as simple as turning on/off a GPIO by writing 1/0 to a characteristic.
In this tutorial (using the old nRF SDK) it is clear how to implement this write handler and initialize it: https://novelbits.io/smart-ble-lightbulb-application-nrf52/. The function in question is the "static void led_write_handler" function that receives a led state uint8_t, and is able to write to an LED. Furthermore, it also shows how to declare a function pointer to it within structure linked to the service and how to initialize it from the main.c
My question is: how can I implement such a function and "register" it with the service? If there's a tutorial that shows how to do it, I'd greatly appreciate it.
Thanks in advance for your help