public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v2 1/2] shared/shell: Add support for -EINPROGRESS to bt_shell_noninteractive_quit
@ 2025-06-05 19:24 Luiz Augusto von Dentz
  2025-06-05 19:24 ` [PATCH BlueZ v2 2/2] client: Use -EINPROGRESS with scan and advertise command Luiz Augusto von Dentz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2025-06-05 19:24 UTC (permalink / raw)
  To: linux-bluetooth

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

This enables commands to call bt_shell_noninteractive_quit with status
set to -EINPROGRESS to indicate their execution is in progress and shall
not exit in case of MODE_NONINTERACTIVE but it can proceed to the next
command for MODE_INTERACTIVE.
---
 src/shared/shell.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/shared/shell.c b/src/shared/shell.c
index 3e5959fc1868..6b4f7a7ef503 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -1560,6 +1560,12 @@ void bt_shell_noninteractive_quit(int status)
 		return;
 	}
 
+	/* Ignore EINPROGRESS as it is meant for commands that need to stay
+	 * running.
+	 */
+	if (status == -EINPROGRESS)
+		return;
+
 	bt_shell_quit(status);
 }
 
-- 
2.49.0


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

* [PATCH BlueZ v2 2/2] client: Use -EINPROGRESS with scan and advertise command
  2025-06-05 19:24 [PATCH BlueZ v2 1/2] shared/shell: Add support for -EINPROGRESS to bt_shell_noninteractive_quit Luiz Augusto von Dentz
@ 2025-06-05 19:24 ` Luiz Augusto von Dentz
  2025-06-05 20:51 ` [BlueZ,v2,1/2] shared/shell: Add support for -EINPROGRESS to bt_shell_noninteractive_quit bluez.test.bot
  2025-06-06 19:00 ` [PATCH BlueZ v2 1/2] " patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2025-06-05 19:24 UTC (permalink / raw)
  To: linux-bluetooth

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 | 9 ++-------
 client/main.c        | 3 ++-
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/client/advertising.c b/client/advertising.c
index 382ae420e663..f9df1b855cde 100644
--- a/client/advertising.c
+++ b/client/advertising.c
@@ -18,6 +18,7 @@
 #include <stdint.h>
 #include <stdbool.h>
 #include <string.h>
+#include <errno.h>
 
 #include "gdbus/gdbus.h"
 #include "src/shared/util.h"
@@ -238,7 +239,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 +875,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[])
@@ -950,8 +949,6 @@ void ad_disable_service(DBusConnection *conn, int type)
 static void ad_clear_manufacturer(int type)
 {
 	memset(&ad.manufacturer[type], 0, sizeof(ad.manufacturer[type]));
-
-	return bt_shell_noninteractive_quit(EXIT_SUCCESS);
 }
 
 void ad_advertise_manufacturer(DBusConnection *conn, int type,
@@ -1006,8 +1003,6 @@ void ad_disable_manufacturer(DBusConnection *conn, int type)
 static void ad_clear_data(int type)
 {
 	memset(&ad.data[type], 0, sizeof(ad.data[type]));
-
-	return bt_shell_noninteractive_quit(EXIT_SUCCESS);
 }
 
 void ad_advertise_data(DBusConnection *conn, int type, 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


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

* RE: [BlueZ,v2,1/2] shared/shell: Add support for -EINPROGRESS to bt_shell_noninteractive_quit
  2025-06-05 19:24 [PATCH BlueZ v2 1/2] shared/shell: Add support for -EINPROGRESS to bt_shell_noninteractive_quit Luiz Augusto von Dentz
  2025-06-05 19:24 ` [PATCH BlueZ v2 2/2] client: Use -EINPROGRESS with scan and advertise command Luiz Augusto von Dentz
@ 2025-06-05 20:51 ` bluez.test.bot
  2025-06-06 19:00 ` [PATCH BlueZ v2 1/2] " patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2025-06-05 20:51 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 1621 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=969046

---Test result---

Test Summary:
CheckPatch                    PENDING   0.27 seconds
GitLint                       PENDING   0.35 seconds
BuildEll                      PASS      20.44 seconds
BluezMake                     PASS      2696.22 seconds
MakeCheck                     PASS      19.90 seconds
MakeDistcheck                 PASS      201.06 seconds
CheckValgrind                 PASS      277.43 seconds
CheckSmatch                   WARNING   301.60 seconds
bluezmakeextell               PASS      128.65 seconds
IncrementalBuild              PENDING   0.22 seconds
ScanBuild                     PASS      917.34 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ v2 1/2] shared/shell: Add support for -EINPROGRESS to bt_shell_noninteractive_quit
  2025-06-05 19:24 [PATCH BlueZ v2 1/2] shared/shell: Add support for -EINPROGRESS to bt_shell_noninteractive_quit Luiz Augusto von Dentz
  2025-06-05 19:24 ` [PATCH BlueZ v2 2/2] client: Use -EINPROGRESS with scan and advertise command Luiz Augusto von Dentz
  2025-06-05 20:51 ` [BlueZ,v2,1/2] shared/shell: Add support for -EINPROGRESS to bt_shell_noninteractive_quit bluez.test.bot
@ 2025-06-06 19:00 ` patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+bluetooth @ 2025-06-06 19:00 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Thu,  5 Jun 2025 15:24:05 -0400 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> This enables commands to call bt_shell_noninteractive_quit with status
> set to -EINPROGRESS to indicate their execution is in progress and shall
> not exit in case of MODE_NONINTERACTIVE but it can proceed to the next
> command for MODE_INTERACTIVE.
> 
> [...]

Here is the summary with links:
  - [BlueZ,v2,1/2] shared/shell: Add support for -EINPROGRESS to bt_shell_noninteractive_quit
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=7d59391bb783
  - [BlueZ,v2,2/2] client: Use -EINPROGRESS with scan and advertise command
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=5499681bc632

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-06-06 18:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-05 19:24 [PATCH BlueZ v2 1/2] shared/shell: Add support for -EINPROGRESS to bt_shell_noninteractive_quit Luiz Augusto von Dentz
2025-06-05 19:24 ` [PATCH BlueZ v2 2/2] client: Use -EINPROGRESS with scan and advertise command Luiz Augusto von Dentz
2025-06-05 20:51 ` [BlueZ,v2,1/2] shared/shell: Add support for -EINPROGRESS to bt_shell_noninteractive_quit bluez.test.bot
2025-06-06 19:00 ` [PATCH BlueZ v2 1/2] " 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