Can someone please, for the love of all that is holy, point me towards some guidance on how to read values of custom characteristics set by another device?
I cannot find this ANYWHERE.
Can someone please, for the love of all that is holy, point me towards some guidance on how to read values of custom characteristics set by another device?
I cannot find this ANYWHERE.
Hi,
Hope this nRF Connect SDK Bluetooth Low Energy tutorial part 1: Custom Service in Peripheral role and this https://academy.nordicsemi.com/topic/blefund-lesson-4-exercise-1/ can help you.
Regards,
Amanda H.
Hi,
Hope this nRF Connect SDK Bluetooth Low Energy tutorial part 1: Custom Service in Peripheral role and this https://academy.nordicsemi.com/topic/blefund-lesson-4-exercise-1/ can help you.
Regards,
Amanda H.
Hi Amanda,
I'm sorry to say this really doesn't help.
Again, I'm trying to read characteristics belonging to a service setup and advertised by another device. Since it's my device, my service, and my characteristics I know all the UUIDs.
What I'm not seeing is a way to read these characteristics.
Please bear in mind, I don't want to read them on my mobile phone - I want to read them from another device.
Are you able to point me to the appropriate sections of those pages, or direct me to a more appropriate resource.
Thanks,
S.
Hi,
You can use bt_gatt_read(). See this example which is used by https://github.com/nrfconnect/sdk-nrf/tree/b108f364ccf11f52248decabb26cb22ffd30f039/samples/bluetooth/central_bas
-Amanda H.
Hi Amanda,
Thank you - This is closer. With this example code in hand I've been able to set up a framework that reads some characteristic values
However, the example you sent revolves around a single characteristic. I have multiple characteristics in the service: some need to be read from, some need to be written to, some need a subscription.
The guidance I'm primarily looking for is on how to set up each unique characteristic for our intended use - this is what I'm not able to find.
Sadly, all of the example code I seem to find is extremely poorly documented. Huge leaps of logic, dependencies on standard/pre-established devices/services, and unclear flow of execution; this is making setting up characteristics very difficult.
Can you point me to guidance on this?
Thanks again,
S.
Hi,
scath said:I have multiple characteristics in the service: some need to be read from, some need to be written to, some need a subscription.
Then, this https://github.com/nrfconnect/sdk-nrf/blob/750b0d51e152534fe274ba66c7cf29b22c45c34a/subsys/bluetooth/services/hrs_client.c would be suitable for your usages which show how to read, write and subscribe characteristics in the Heart Rate Service.
You can take a look at the Generic Attribute Profile (GATT) documentation.
-Amanda H.
Thanks for the speedy reply, Amanda. I'll take a look asap!
Cheers!