* [PATCH BlueZ] client/btpclient: Improve GATT read
@ 2026-09-01 12:54 Frédéric Danis
2026-09-01 15:04 ` [BlueZ] " bluez.test.bot
0 siblings, 1 reply; 2+ messages in thread
From: Frédéric Danis @ 2026-09-01 12:54 UTC (permalink / raw)
To: linux-bluetooth
BAP/UCL/CGITT/* tests request to read the different Sink/Source
Audio Stream Endpoint characteristics.
The first ReadValue call triggers read of the other characteristics
and PTS, which tracks the read requests, may disconnect before the
following explicit ReadValue has been replied.
First try to read the characteristic value from the proxy cache
before calling ReadValue explicitly.
---
client/btpclient/gatt.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/client/btpclient/gatt.c b/client/btpclient/gatt.c
index d384b9c74..bd9145173 100644
--- a/client/btpclient/gatt.c
+++ b/client/btpclient/gatt.c
@@ -376,6 +376,7 @@ static void btp_gatt_read(uint8_t index, const void *param,
uint8_t status = BTP_ERROR_FAIL;
bool prop;
struct gatt_attribute *characteristic;
+ struct l_dbus_message_iter iter;
if (!adapter) {
status = BTP_ERROR_INVALID_INDEX;
@@ -399,6 +400,30 @@ static void btp_gatt_read(uint8_t index, const void *param,
if (!characteristic)
goto failed;
+ /* First try to read the property value from the proxy cache */
+ if (l_dbus_proxy_get_property(characteristic->proxy, "Value", "ay",
+ &iter)) {
+ uint8_t *data;
+ uint32_t n;
+
+ if (l_dbus_message_iter_get_fixed_array(&iter, &data, &n) &&
+ n > 0) {
+ struct btp_gatt_read_rp *rp;
+
+ rp = malloc(sizeof(struct btp_gatt_read_rp) + n);
+ rp->response = 0;
+ rp->len = n;
+ memcpy(rp->data, data, n);
+
+ btp_send(btp, BTP_GATT_SERVICE, BTP_OP_GATT_READ,
+ adapter->index,
+ sizeof(struct btp_gatt_read_rp) + n, rp);
+
+ free(rp);
+ return;
+ }
+ }
+
l_dbus_proxy_method_call(characteristic->proxy, "ReadValue",
gatt_read_setup, gatt_read_reply,
adapter, NULL);
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [BlueZ] client/btpclient: Improve GATT read
2026-09-01 12:54 [PATCH BlueZ] client/btpclient: Improve GATT read Frédéric Danis
@ 2026-09-01 15:04 ` bluez.test.bot
0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2026-09-01 15:04 UTC (permalink / raw)
To: linux-bluetooth, frederic.danis
[-- Attachment #1: Type: text/plain, Size: 1240 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=1155344
---Test result---
Test Summary:
CheckPatch PASS 0.95 seconds
GitLint PASS 0.21 seconds
BuildEll PASS 21.05 seconds
BluezMake PASS 630.53 seconds
CheckSmatch WARNING 330.70 seconds
bluezmakeextell PASS 105.59 seconds
IncrementalBuild PASS 635.85 seconds
ScanBuild PASS 1031.83 seconds
Details
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
client/btpclient/gatt.c: note: in included file:./src/shared/btp.h:335:41: warning: array of flexible structures./src/shared/btp.h:340:55: warning: array of flexible structures./src/shared/btp.h:363:47: warning: array of flexible structures./src/shared/btp.h:392:42: warning: array of flexible structures
https://github.com/bluez/bluez/pull/2465
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-01 15:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-01 12:54 [PATCH BlueZ] client/btpclient: Improve GATT read Frédéric Danis
2026-09-01 15:04 ` [BlueZ] " bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox