Parent: 6bc64be14b9c1cbcf046b6061087b2b9e3a7f5d5
Author: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Committer: Szymon Janc <szymon.janc@codecoup.pl>
Date: 2016-02-05 12:00:22
Tree: ffd78b5ef42585d38d32ba3a2e9aa15c854e97be
shared/gatt-client: Make read_long_value more robust Using "Read Blob Request" on attributes shorter than ATT_MTU - 3 may return "Attribute Not Long" error on some values, but at the same time it's ok to read this attribute using "Read Request". Since using "Read Blob Request" as first request when reading long characteristic value starting with offset 0 is optional, this patch changes read_long_value to start with "Read Request" whenever possible to remove need for caller to take care of such error. Core v4.2, part F, section 1.3.4.4.5: If the attribute value has a fixed length that is less than or equal to (ATT_MTU - 3) octets in length, then an Error Response can be sent with the error code «Attribute Not Long».
Diffstat
| M | src/shared/gatt-client.c | | | 36 | ++++++++++++++++++++++++++++++- - - - - - |
| M | unit/test-gatt.c | | | 78 | +++++++++++++++++++++++++++++++++++++++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
2 files changed, 69 insertions(+), 45 deletions(-)