After a lot of help, I've managed to get a central_uart with custom UUIDs going.
After stripping out as much unwanted code and callback functions as possible, moving UART and BLE code into their own files, getting rid of all mallocs and unnecessary queues, without all that noise, I think I now finally just about understand how all the stuff knits together and basically understand how you, as a client, get data off a server. At least, if you subscribe to a characteristic.
In this particular instance, I need to read one more two byte characteristic, but not subscribe to get notification of change. That characteristic will be set to a value before I try to connect to the remote unit and it will not change after that. So, how can I, as a client, simply read the value in a characteristic on a server?
I've tried searching for this and the closest I can find is this:
How to correctly read from a Characteristic
But it makes no sense to me. It says call:
sd_ble_gattc_read
But that doesn't, as far as I can see actually read the data that's in the characteristic. It returns a 32-bit value indicating success of failure (which really should be an enum IMHO), but not data. So what do you call to get the data out of the characteristic on the server?
Also, for that function call in the API details on line it says:
offset Offset into the attribute value to be read.
What does that even mean?
Am assuming conn_handle and handle are found when you do the gatt_discover.
As with all these things with this ecosystem it would be really useful to have very basic, clearly written examples. Maybe there is one somewhere, but I can't find it.
Thanks.