All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v2] tools/obexctl: Add command line options to support session/system bus
@ 2024-11-12  4:50 quic_dgangire
  2024-11-12  6:40 ` [BlueZ,v2] " bluez.test.bot
  2024-11-12 16:28 ` [PATCH BlueZ v2] " Luiz Augusto von Dentz
  0 siblings, 2 replies; 3+ messages in thread
From: quic_dgangire @ 2024-11-12  4:50 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: quic_mohamull, quic_hbandi, quic_anubhavg

From: Damodar Reddy GangiReddy <quic_dgangire@quicinc.com>

Currently obexctl only uses session bus.
As obexd has been enabled support for both session and system bus.
Configuring obexctl to use session/system bus during the runtime
with command line options.
./obexctl --bustype=system or --bustype=session.
By Default session bus will be used.

---
 tools/obexctl.c | 30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

diff --git a/tools/obexctl.c b/tools/obexctl.c
index a398b095b..d88ffc9fe 100644
--- a/tools/obexctl.c
+++ b/tools/obexctl.c
@@ -2149,16 +2149,42 @@ static void property_changed(GDBusProxy *proxy, const char *name,
 		session_property_changed(proxy, name, iter);
 }
 
+static const char *help[] = {
+		"Configures either session or system bus.By Default session bus is used",
+};
+
+static const char *bustype_option;
+
+static const char **optargs[] = {
+		&bustype_option
+};
+
+static const struct option options[] = {
+		{ "bustype", required_argument, 0, 'b' },
+		{ 0, 0, 0, 0 }
+};
+
+static const struct bt_shell_opt opt = {
+		.options = options,
+		.optno = sizeof(options) / sizeof(struct option),
+		.optstr = "b",
+		.optarg = optargs,
+		.help = help,
+};
+
 int main(int argc, char *argv[])
 {
 	GDBusClient *client;
 	int status;
 
-	bt_shell_init(argc, argv, NULL);
+	bt_shell_init(argc, argv, &opt);
 	bt_shell_set_menu(&main_menu);
 	bt_shell_set_prompt(PROMPT, NULL);
 
-	dbus_conn = g_dbus_setup_bus(DBUS_BUS_SESSION, NULL, NULL);
+	if (bustype_option && !(strcmp(bustype_option, "system")))
+		dbus_conn = g_dbus_setup_bus(DBUS_BUS_SYSTEM, NULL, NULL);
+	else
+		dbus_conn = g_dbus_setup_bus(DBUS_BUS_SESSION, NULL, NULL);
 
 	client = g_dbus_client_new(dbus_conn, "org.bluez.obex",
 							"/org/bluez/obex");
-- 
2.34.1


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

* RE: [BlueZ,v2] tools/obexctl: Add command line options to support session/system bus
  2024-11-12  4:50 [PATCH BlueZ v2] tools/obexctl: Add command line options to support session/system bus quic_dgangire
@ 2024-11-12  6:40 ` bluez.test.bot
  2024-11-12 16:28 ` [PATCH BlueZ v2] " Luiz Augusto von Dentz
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2024-11-12  6:40 UTC (permalink / raw)
  To: linux-bluetooth, quic_dgangire

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

---Test result---

Test Summary:
CheckPatch                    FAIL      7.37 seconds
GitLint                       PASS      0.30 seconds
BuildEll                      PASS      24.44 seconds
BluezMake                     PASS      1687.47 seconds
MakeCheck                     PASS      13.18 seconds
MakeDistcheck                 PASS      178.69 seconds
CheckValgrind                 PASS      253.09 seconds
CheckSmatch                   PASS      356.69 seconds
bluezmakeextell               PASS      120.05 seconds
IncrementalBuild              PASS      1412.88 seconds
ScanBuild                     PASS      1008.18 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[BlueZ,v2] tools/obexctl: Add command line options to support session/system bus
WARNING:STATIC_CONST_CHAR_ARRAY: static const char * array should probably be static const char * const
#115: FILE: tools/obexctl.c:2152:
+static const char *help[] = {

/github/workspace/src/src/13871714.patch total: 0 errors, 1 warnings, 44 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

/github/workspace/src/src/13871714.patch has style problems, please review.

NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.




---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ v2] tools/obexctl: Add command line options to support session/system bus
  2024-11-12  4:50 [PATCH BlueZ v2] tools/obexctl: Add command line options to support session/system bus quic_dgangire
  2024-11-12  6:40 ` [BlueZ,v2] " bluez.test.bot
@ 2024-11-12 16:28 ` Luiz Augusto von Dentz
  1 sibling, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2024-11-12 16:28 UTC (permalink / raw)
  To: quic_dgangire; +Cc: linux-bluetooth, quic_mohamull, quic_hbandi, quic_anubhavg

Hi,

On Mon, Nov 11, 2024 at 11:50 PM <quic_dgangire@quicinc.com> wrote:
>
> From: Damodar Reddy GangiReddy <quic_dgangire@quicinc.com>
>
> Currently obexctl only uses session bus.
> As obexd has been enabled support for both session and system bus.
> Configuring obexctl to use session/system bus during the runtime
> with command line options.
> ./obexctl --bustype=system or --bustype=session.
> By Default session bus will be used.

I think we should probably attempt to detect at runtime if the name is
available over session or system.

> ---
>  tools/obexctl.c | 30 ++++++++++++++++++++++++++++--
>  1 file changed, 28 insertions(+), 2 deletions(-)
>
> diff --git a/tools/obexctl.c b/tools/obexctl.c
> index a398b095b..d88ffc9fe 100644
> --- a/tools/obexctl.c
> +++ b/tools/obexctl.c
> @@ -2149,16 +2149,42 @@ static void property_changed(GDBusProxy *proxy, const char *name,
>                 session_property_changed(proxy, name, iter);
>  }
>
> +static const char *help[] = {
> +               "Configures either session or system bus.By Default session bus is used",
> +};
> +
> +static const char *bustype_option;
> +
> +static const char **optargs[] = {
> +               &bustype_option
> +};
> +
> +static const struct option options[] = {
> +               { "bustype", required_argument, 0, 'b' },
> +               { 0, 0, 0, 0 }
> +};
> +
> +static const struct bt_shell_opt opt = {
> +               .options = options,
> +               .optno = sizeof(options) / sizeof(struct option),
> +               .optstr = "b",
> +               .optarg = optargs,
> +               .help = help,
> +};
> +
>  int main(int argc, char *argv[])
>  {
>         GDBusClient *client;
>         int status;
>
> -       bt_shell_init(argc, argv, NULL);
> +       bt_shell_init(argc, argv, &opt);
>         bt_shell_set_menu(&main_menu);
>         bt_shell_set_prompt(PROMPT, NULL);
>
> -       dbus_conn = g_dbus_setup_bus(DBUS_BUS_SESSION, NULL, NULL);
> +       if (bustype_option && !(strcmp(bustype_option, "system")))
> +               dbus_conn = g_dbus_setup_bus(DBUS_BUS_SYSTEM, NULL, NULL);
> +       else
> +               dbus_conn = g_dbus_setup_bus(DBUS_BUS_SESSION, NULL, NULL);
>
>         client = g_dbus_client_new(dbus_conn, "org.bluez.obex",
>                                                         "/org/bluez/obex");
> --
> 2.34.1
>
>


-- 
Luiz Augusto von Dentz

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

end of thread, other threads:[~2024-11-12 16:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-12  4:50 [PATCH BlueZ v2] tools/obexctl: Add command line options to support session/system bus quic_dgangire
2024-11-12  6:40 ` [BlueZ,v2] " bluez.test.bot
2024-11-12 16:28 ` [PATCH BlueZ v2] " Luiz Augusto von Dentz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.