I am trying to learn how to configure a central-peripheral connection using zephyr samples.
To do this, I am working on a simple button-LED service with two nrf52840 dev kits.
The service includes LED characteristics with Write permission and Button characteristics with Read permission.
For the peripheral I am using nordic LBS exercise in lesson 4.
First, I set up the peripheral and made sure that the it works perfectly via the nordic app, I can turn on/off using the nordic app on my phone.
Next, I set up the central device on the second nrf52840 SDK and I checked for the connections.
The two devices are connected and the service and characteristics are discovered on the central device.
As being used in the zephyr central_hr sample, after sequentially discovering the characteristics via UUID comparison, I can see that the device moves to subscribed status.
Furthermore, I have used a call-back function on the central device to trigger the gatt-write on the LED characteristics by pressing a button on the central SDK.
However, when I do that, although it executes the gatt_write function targeted for the discovered-handle-associated-with-the-LED-characteristic, it does not trigger the call-back function on the peripheral sdk and as the result, the LED will never turn on.
For the write, I am using the following code:
What do you think that can cause this issue? How can I fix or troubleshoot this? Any help or idea would be much appreciated.
Thanks.