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 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 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!
Hi Amanda,
I appreciate the effort, and I've been able to work out some of what's happening here, but I have to say that the documentation is absolutely awful.
Having reviewed the code you suggested, I find exactly 4 short comments across several hundred lines of code. It vaguely lays out a strategy for setting up the BLE framework, but has no guidance on actually implementing the code.
For example: Lines 185:218 of `hrs_client.c` define `bt_hrs_client_measurement_subscribe()`... but there's no demonstration or discussion on where this actually gets called. That's confusing, since this method requires a custom callback as an argument. It would be very helpful to see where that method gets called, and the custom callback declared and set up for actual execution.
Can I ask you for some guidance on setting this up, and/or where I can find discussion on the intended execution path for the multithreaded BLE system? Though I admittedly may not have seen it, I'm not finding information on this.
Many thanks,
S.