shared/gatt-client: Make read_long_value more robust

System Internals / BlueZ - Andrzej Kaczmarek [codecoup.pl] - 5 February 2016 04:00 UTC

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».

707887a shared/gatt-client: Make read_long_value more robust
src/shared/gatt-client.c | 36 +++++++++++++++++----
unit/test-gatt.c | 78 +++++++++++++++++++++++-----------------------
2 files changed, 69 insertions(+), 45 deletions(-)

Upstream: git.kernel.org


  • Share