public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v1] client: Fix gatt.{read, write} not working on scripts
@ 2025-07-21 20:09 Luiz Augusto von Dentz
  2025-07-21 21:32 ` [BlueZ,v1] " bluez.test.bot
  2025-07-23 14:40 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2025-07-21 20:09 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If gatt.{read, write} are called within a script they don't indicate
completion so they block commands to be run after them.
---
 client/gatt.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/client/gatt.c b/client/gatt.c
index b18186518953..6dc80e2a31cd 100644
--- a/client/gatt.c
+++ b/client/gatt.c
@@ -696,6 +696,8 @@ void gatt_read_local_attribute(char *data, int argc, char *argv[])
 		bt_shell_hexdump(&d->value[offset], d->value_len - offset);
 		return bt_shell_noninteractive_quit(EXIT_SUCCESS);
 	}
+
+	return bt_shell_noninteractive_quit(EXIT_FAILURE);
 }
 
 static uint8_t *str2bytearray(char *arg, size_t *val_len)
@@ -809,6 +811,8 @@ void gatt_write_local_attribute(char *data, int argc, char *argv[])
 	}
 
 	free(value);
+
+	return bt_shell_noninteractive_quit(EXIT_SUCCESS);
 }
 
 static char *attribute_generator(const char *text, int state, GList *source)
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-23 14:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-21 20:09 [PATCH BlueZ v1] client: Fix gatt.{read, write} not working on scripts Luiz Augusto von Dentz
2025-07-21 21:32 ` [BlueZ,v1] " bluez.test.bot
2025-07-23 14:40 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox