Background:
We are working on a project based on the HostTestApp example application. Our previous
colleagues extended this application to enable communication with another MCU over SPI.
Our application has a service with a custom characteristic containing one attribute. Callback functions for read/write between the example application and the extended part have been registered together with the service using the function GATTServApp_RegisterService.
The question:
If we write 20 bytes to this characteristic from BTool, the sniffer shows that 20 bytes are sent.
However, the BLE stack receives the 20 bytes but forwards them to the extension in two events. So the callback function is called twice: The first time with the first 18 bytes and an
offset of 0, and the second event with the last 2 bytes and an offset of 18 bytes.
If we send 19 bytes from BTool, there will also be two "events". One with 18 bytes and
one with 1 byte.
Why does the stack split the message into 18 + x bytes if it is longer than 18 bytes?
Is there a way to change this limit from 18 to 20?