0

I'm using BTool, together with a TI Launchpad and the nRF Connect mobile app on my Samsung S21. I am curious, what type of services nRF Connect can be used, that send notifications to my TI Launchpad whenever their value is changed. Not periodically. Only after their value is changed.

I tried using a Battery Level service, but I'm not sure on how to "subscribe" to that service (how to enable notifications) from BTool.

Any advice?

Mario Mateaș
  • 638
  • 7
  • 25

1 Answers1

0

According to this BTool User Guide I found the process of enabling notifications is as follows:

In order to enable notifications, the client device must write a value of 0x0001 to the client characteristic configuration descriptor (CCCD) for the particular characteristic. The handle for the CCCD immediately follows the characteristic value’s handle. Therefore, a value of 0x0001 must be written to the “handle + 1”.

The Battery Service you created has the UUID 0x180F and you have to get the handle for this characteristic. One way is described in the part about reading a characteristic by UUID.

To do this, you will first need to click the “Read/Write” tab in BTool. Select the option “Read Using Characteristic UUID” under the”sub-procedure” option in the “Characteristic Read” section at the top of the screen. Enter the UUID (note that the LSB is entered first, and the MSB is entered last) in the “Characteristic UUID” box, and click the “Read” button.

You can now access the CCCD using "handle + 1" as described earlier. To enable the notifications just write 0x0001 to that handle.

Michael Kotzjan
  • 2,093
  • 2
  • 14
  • 23