Skip to main content
BMcGe.1
Associate
Jun 5, 2023 3:19 PM UTC
Question

How can BLE server access its own characteristics?

I am working with the STM32WB15 controller. I have implemented a few custom BLE characteristics and I want to be able to check the value of the characteristics on the server side (not from a read request from a client device). Is there a way to access the current value of a characteristic?

This topic has been closed for replies.

1 reply

Explorer
Jun 29, 2023 9:33 PM UTC

Try aci_gatt_read_handle_value

aci_gatt_read_handle_value((CustomContext.CustomMyTestCharHdle + CHARACTERISTIC_VALUE_ATTRIBUTE_OFFSET),
 0, /* charValOffset */
 SizeMyTestChar, /* wanted length of data */
 &ret_len, /* will return the actual length read */
 &buffer_len, /* a pointer to the length of buffer */
 buffer /* actual buffer */);

I found it in the AN5270 document