From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ v1 2/2] client: Use -EINPROGRESS with scan and advertise command
Date: Thu, 5 Jun 2025 14:15:42 -0400 [thread overview]
Message-ID: <20250605181542.854629-2-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20250605181542.854629-1-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This uses -EINPROGRESS with commands scan and advertise since they need
to keep running in the background so they don't exit but shouldn't block
other command from executing in case they are invoked from a script.
---
client/advertising.c | 4 +---
client/main.c | 3 ++-
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/client/advertising.c b/client/advertising.c
index 382ae420e663..6e1c70309fb5 100644
--- a/client/advertising.c
+++ b/client/advertising.c
@@ -238,7 +238,7 @@ static void register_reply(DBusMessage *message, void *user_data)
ad.registered = true;
bt_shell_printf("Advertising object registered\n");
print_ad();
- /* Leave advertise running even on noninteractive mode */
+ return bt_shell_noninteractive_quit(-EINPROGRESS);
} else {
bt_shell_printf("Failed to register advertisement: %s\n", error.name);
dbus_error_free(&error);
@@ -874,8 +874,6 @@ static void ad_clear_service(int type)
{
g_free(ad.service[type].uuid);
memset(&ad.service[type], 0, sizeof(ad.service[type]));
-
- return bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
static bool ad_add_data(struct ad_data *data, int argc, char *argv[])
diff --git a/client/main.c b/client/main.c
index c2321952bd4f..d99a5158e35a 100644
--- a/client/main.c
+++ b/client/main.c
@@ -1219,7 +1219,8 @@ static void start_discovery_reply(DBusMessage *message, void *user_data)
bt_shell_printf("Discovery %s\n", enable ? "started" : "stopped");
filter.active = enable;
- /* Leave the discovery running even on noninteractive mode */
+
+ return bt_shell_noninteractive_quit(-EINPROGRESS);
}
static void clear_discovery_filter(DBusMessageIter *iter, void *user_data)
--
2.49.0
next prev parent reply other threads:[~2025-06-05 18:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-05 18:15 [PATCH BlueZ v1 1/2] shared/shell: Add support for -EINPROGRESS to bt_shell_noninteractive_quit Luiz Augusto von Dentz
2025-06-05 18:15 ` Luiz Augusto von Dentz [this message]
2025-06-05 19:11 ` [BlueZ,v1,1/2] " bluez.test.bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250605181542.854629-2-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox