* [PATCH bluez v2] shared/gatt-db: Add read offset to record the progress of att read blob request
@ 2025-05-27 8:12 Ye He via B4 Relay
2025-05-27 9:32 ` [bluez,v2] " bluez.test.bot
2025-05-27 12:48 ` [PATCH bluez v2] " Luiz Augusto von Dentz
0 siblings, 2 replies; 3+ messages in thread
From: Ye He via B4 Relay @ 2025-05-27 8:12 UTC (permalink / raw)
To: Linux Bluetooth; +Cc: Ye He
From: Ye He <ye.he@amlogic.com>
When processing the att read blob request packet sent
by the mobile phone, Bluez ignores the offset and the
payload of each att read blob response is the same.
This patch add read offset to record the progress of
att read blob request.
Fixes: https://github.com/bluez/bluez/issues/1294
Signed-off-by: Ye He <ye.he@amlogic.com>
---
Changes in v2:
- Fix build error.
- Link to v1: https://patch.msgid.link/20250527-att-read-blob-rsp-err-v1-1-75d3bc498862@amlogic.com
---
src/shared/gatt-db.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/shared/gatt-db.c b/src/shared/gatt-db.c
index 8951079beef1a8af7e46e87043f320640d4109f7..06af4f65bacaac39cdf9641e40fac902653c4b9c 100644
--- a/src/shared/gatt-db.c
+++ b/src/shared/gatt-db.c
@@ -109,6 +109,7 @@ struct gatt_db_attribute {
uint32_t permissions;
uint16_t value_len;
uint8_t *value;
+ uint16_t read_offset;
gatt_db_read_t read_func;
gatt_db_write_t write_func;
@@ -151,7 +152,8 @@ static void pending_read_result(struct pending_read *p, int err,
if (p->timeout_id > 0)
timeout_remove(p->timeout_id);
- p->func(p->attrib, err, data, length, p->user_data);
+ p->func(p->attrib, err, data + p->attrib->read_offset,
+ length - p->attrib->read_offset, p->user_data);
free(p);
}
@@ -2126,6 +2128,8 @@ bool gatt_db_attribute_read(struct gatt_db_attribute *attrib, uint16_t offset,
if (!attrib || !func)
return false;
+ attrib->read_offset = offset;
+
/* Check boundaries if value_len is set */
if (attrib->value_len && offset > attrib->value_len) {
func(attrib, BT_ATT_ERROR_INVALID_OFFSET, NULL, 0, user_data);
---
base-commit: c888c682fbd4e02dce6bf4c1f9a47328ceb02716
change-id: 20250527-att-read-blob-rsp-err-c30db15efd30
Best regards,
--
Ye He <ye.he@amlogic.com>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [bluez,v2] shared/gatt-db: Add read offset to record the progress of att read blob request
2025-05-27 8:12 [PATCH bluez v2] shared/gatt-db: Add read offset to record the progress of att read blob request Ye He via B4 Relay
@ 2025-05-27 9:32 ` bluez.test.bot
2025-05-27 12:48 ` [PATCH bluez v2] " Luiz Augusto von Dentz
1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2025-05-27 9:32 UTC (permalink / raw)
To: linux-bluetooth, ye.he
[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=966581
---Test result---
Test Summary:
CheckPatch PENDING 0.25 seconds
GitLint PENDING 0.27 seconds
BuildEll PASS 20.28 seconds
BluezMake PASS 2579.39 seconds
MakeCheck PASS 20.27 seconds
MakeDistcheck PASS 198.02 seconds
CheckValgrind PASS 275.29 seconds
CheckSmatch PASS 300.30 seconds
bluezmakeextell PASS 128.35 seconds
IncrementalBuild PENDING 0.26 seconds
ScanBuild PASS 903.27 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH bluez v2] shared/gatt-db: Add read offset to record the progress of att read blob request
2025-05-27 8:12 [PATCH bluez v2] shared/gatt-db: Add read offset to record the progress of att read blob request Ye He via B4 Relay
2025-05-27 9:32 ` [bluez,v2] " bluez.test.bot
@ 2025-05-27 12:48 ` Luiz Augusto von Dentz
1 sibling, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2025-05-27 12:48 UTC (permalink / raw)
To: ye.he; +Cc: Linux Bluetooth
Hi,
On Tue, May 27, 2025 at 4:13 AM Ye He via B4 Relay
<devnull+ye.he.amlogic.com@kernel.org> wrote:
>
> From: Ye He <ye.he@amlogic.com>
>
> When processing the att read blob request packet sent
> by the mobile phone, Bluez ignores the offset and the
> payload of each att read blob response is the same.
>
> This patch add read offset to record the progress of
> att read blob request.
>
> Fixes: https://github.com/bluez/bluez/issues/1294
>
> Signed-off-by: Ye He <ye.he@amlogic.com>
> ---
> Changes in v2:
> - Fix build error.
> - Link to v1: https://patch.msgid.link/20250527-att-read-blob-rsp-err-v1-1-75d3bc498862@amlogic.com
> ---
> src/shared/gatt-db.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/shared/gatt-db.c b/src/shared/gatt-db.c
> index 8951079beef1a8af7e46e87043f320640d4109f7..06af4f65bacaac39cdf9641e40fac902653c4b9c 100644
> --- a/src/shared/gatt-db.c
> +++ b/src/shared/gatt-db.c
> @@ -109,6 +109,7 @@ struct gatt_db_attribute {
> uint32_t permissions;
> uint16_t value_len;
> uint8_t *value;
> + uint16_t read_offset;
>
> gatt_db_read_t read_func;
> gatt_db_write_t write_func;
> @@ -151,7 +152,8 @@ static void pending_read_result(struct pending_read *p, int err,
> if (p->timeout_id > 0)
> timeout_remove(p->timeout_id);
>
> - p->func(p->attrib, err, data, length, p->user_data);
> + p->func(p->attrib, err, data + p->attrib->read_offset,
> + length - p->attrib->read_offset, p->user_data);
>
> free(p);
> }
> @@ -2126,6 +2128,8 @@ bool gatt_db_attribute_read(struct gatt_db_attribute *attrib, uint16_t offset,
> if (!attrib || !func)
> return false;
>
> + attrib->read_offset = offset;
> +
> /* Check boundaries if value_len is set */
> if (attrib->value_len && offset > attrib->value_len) {
> func(attrib, BT_ATT_ERROR_INVALID_OFFSET, NULL, 0, user_data);
This is not quite right, first there is the problem that you are
storing it in the gatt_db_attribute itself, so it will affect
subsequent requests, rather than storing the offset at pending_read,
but even then this would be wrong since the intention is that the
offset is handled by the read_func otherwise we wouldn't bother
passing the offset to the it.
> ---
> base-commit: c888c682fbd4e02dce6bf4c1f9a47328ceb02716
> change-id: 20250527-att-read-blob-rsp-err-c30db15efd30
>
> Best regards,
> --
> Ye He <ye.he@amlogic.com>
>
>
>
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-27 12:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-27 8:12 [PATCH bluez v2] shared/gatt-db: Add read offset to record the progress of att read blob request Ye He via B4 Relay
2025-05-27 9:32 ` [bluez,v2] " bluez.test.bot
2025-05-27 12:48 ` [PATCH bluez v2] " Luiz Augusto von Dentz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox