The peripheral application I'm working on implements a service which must handle multi-byte incoming messages from a central device and would welcome a pointer to any example code that demonstrates how I might code this. (I am working on a ublox BMD-330 dev board targeting nrf52810 and using the BLE Scanner app on my iPhone for testing so do not know how this app is actually sending the data, but there is a button to send either a single byte or a string.)
The single byte is being received fine but when I try to send e.g. "zz" nothing is received (apparently). I have based my code on the example MIDI code here - www.novelbits.io/.../ - the 'on_write()' function in midi_service.c seems to have code for processing either 1 or 2 bytes but debugging this function seems to show that it is never even hit unless the incoming data is a single byte.
There is a comment in the 'ble_gatts_evt_write_t' structure (where the 'data' member is an array of size 1) that says:
/**< Received data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
However I can find nothing in the sdk doc related to sd_ble_evt_get that mentions anything about handling multi-byte data. I am happy to share if necessary such code as I have but really all I need is a pointer to an example of what the 'on_write' event handler should look like or if my service needs some extra code.
Thanks for any help.