With this patch long write and nested long write reliable is supported. GATT server is responsible now to do aggregation of prep write data for long write session. Note: We consider long write as the consequtive prepare writes with continues offsets.
E.g. 1
prep_write: handle 1, offset 0, value_len 10 prep_write: handle 1, offset 10, value_len 10 prep_write: handle 2, offset 0, value_len 10 prep_write: handle 2, offset 10, value_len 10
Will result with following calles to app:
exec_write: handle 1: offset 0, value_len 20 exec_write: handle 2: offset 0, value_len 20
E.g. 2
prep_write: handle 1, offset 0, value_len 10 prep_write: handle 1, offset 2, value_len 5 prep_write: handle 2, offset 0, value_len 10 prep_write: handle 2, offset 4, value_len 5
Will result with following calles to app:
exec_write: handle 1: offset 0, value_len 10 exec_write: handle 1: offset 2, value_len 5 exec_write: handle 2: offset 0, value_len 10 exec_write: handle 2: offset 4, value_len 5
E.g. 3 prep_write: handle 1, offset 0, value_len 10 prep_write: handle 1, offset 5, value_len 5 prep_write: handle 1, offset 10, value_len 6
will result with following calles to app:
exec_write: handle 1, offset 0, value 10 exec_write: handle 1, offset 5, value 11
55bcfbc shared/gatt-server: Add support for long write
src/shared/gatt-server.c | 87 +++++++++++++++++++++++++++++++++++-----------
1 file changed, 67 insertions(+), 20 deletions(-)
Upstream: git.kernel.org