linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] tools/mesh-cfgclient: Fix signatures in agent methods
@ 2019-11-22 16:23 Inga Stotland
  2019-11-22 18:29 ` Steve Brown
  2019-11-22 19:22 ` Gix, Brian
  0 siblings, 2 replies; 6+ messages in thread
From: Inga Stotland @ 2019-11-22 16:23 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: brian.gix, sbrown, Inga Stotland

This removes an extra return parameter from PromptNumeric and PromptStatic
method signatures. Also, style fixes.
---
 tools/mesh-cfgclient.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/mesh-cfgclient.c b/tools/mesh-cfgclient.c
index 1c617a37b..200eb5b84 100644
--- a/tools/mesh-cfgclient.c
+++ b/tools/mesh-cfgclient.c
@@ -478,6 +478,7 @@ static struct l_dbus_message *disp_string_call(struct l_dbus *dbus,
 						struct l_dbus_message *msg,
 						void *user_data)
 {
+	const char *prompt = "Enter AlphaNumeric code on remote device:";
 	char *str;
 
 	if (!l_dbus_message_get_arguments(msg, "s", &str)) {
@@ -485,7 +486,7 @@ static struct l_dbus_message *disp_string_call(struct l_dbus *dbus,
 		return l_dbus_message_new_error(msg, dbus_err_fail, NULL);
 	}
 
-	bt_shell_printf(COLOR_YELLOW "Enter AlphaNumeric code on remote device: %s\n" COLOR_OFF, str);
+	bt_shell_printf(COLOR_YELLOW "%s %s\n" COLOR_OFF, prompt, str);
 
 	return l_dbus_message_new_method_return(msg);
 }
@@ -542,13 +543,13 @@ static void setup_agent_iface(struct l_dbus_interface *iface)
 								NULL);
 	/* TODO: Other properties */
 	l_dbus_interface_method(iface, "DisplayString", 0, disp_string_call,
-						"", "s", "value");
+							"", "s", "value");
 	l_dbus_interface_method(iface, "DisplayNumeric", 0, disp_numeric_call,
 						"", "su", "type", "number");
 	l_dbus_interface_method(iface, "PromptNumeric", 0, prompt_numeric_call,
-						"u", "s", "type");
+						"u", "s", "number", "type");
 	l_dbus_interface_method(iface, "PromptStatic", 0, prompt_static_call,
-						"ay", "s", "type");
+						"ay", "s", "data", "type");
 }
 
 static bool register_agent(void)
-- 
2.21.0


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

* Re: [PATCH BlueZ] tools/mesh-cfgclient: Fix signatures in agent methods
  2019-11-22 16:23 [PATCH BlueZ] tools/mesh-cfgclient: Fix signatures in agent methods Inga Stotland
@ 2019-11-22 18:29 ` Steve Brown
  2019-11-22 18:51   ` Stotland, Inga
  2019-11-22 19:22 ` Gix, Brian
  1 sibling, 1 reply; 6+ messages in thread
From: Steve Brown @ 2019-11-22 18:29 UTC (permalink / raw)
  To: Inga Stotland, linux-bluetooth; +Cc: brian.gix

Hi Inga,

On Fri, 2019-11-22 at 08:23 -0800, Inga Stotland wrote:
> This removes an extra return parameter from PromptNumeric and
> PromptStatic
> method signatures. Also, style fixes.
> ---
>  tools/mesh-cfgclient.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/mesh-cfgclient.c b/tools/mesh-cfgclient.c
> index 1c617a37b..200eb5b84 100644
> --- a/tools/mesh-cfgclient.c
> +++ b/tools/mesh-cfgclient.c
> 

SIGSEGV still gone.

I tested both the prompt_numeric_call and prompt_static_call paths and
they work as expected. I used the Zephyr onoff-app for testing.

I think the commit message refers to the V1 patch.

Steve




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

* Re: [PATCH BlueZ] tools/mesh-cfgclient: Fix signatures in agent methods
  2019-11-22 18:29 ` Steve Brown
@ 2019-11-22 18:51   ` Stotland, Inga
  0 siblings, 0 replies; 6+ messages in thread
From: Stotland, Inga @ 2019-11-22 18:51 UTC (permalink / raw)
  To: sbrown, linux-bluetooth; +Cc: Gix, Brian

Hi Steve,

On Fri, 2019-11-22 at 11:29 -0700, Steve Brown wrote:
> Hi Inga,
> 
> On Fri, 2019-11-22 at 08:23 -0800, Inga Stotland wrote:
> > This removes an extra return parameter from PromptNumeric and
> > PromptStatic
> > method signatures. Also, style fixes.
> > ---
> >  tools/mesh-cfgclient.c | 9 +++++----
> >  1 file changed, 5 insertions(+), 4 deletions(-)
> > 
> > diff --git a/tools/mesh-cfgclient.c b/tools/mesh-cfgclient.c
> > index 1c617a37b..200eb5b84 100644
> > --- a/tools/mesh-cfgclient.c
> > +++ b/tools/mesh-cfgclient.c
> > 
> 
> SIGSEGV still gone.
> 
> I tested both the prompt_numeric_call and prompt_static_call paths and
> they work as expected. I used the Zephyr onoff-app for testing.
> 
> I think the commit message refers to the V1 patch.
> 
> Steve
> 

Thank you for confirming. Yes, will fix the commit message.

Best regards,
Inga

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

* Re: [PATCH BlueZ] tools/mesh-cfgclient: Fix signatures in agent methods
  2019-11-22 16:23 [PATCH BlueZ] tools/mesh-cfgclient: Fix signatures in agent methods Inga Stotland
  2019-11-22 18:29 ` Steve Brown
@ 2019-11-22 19:22 ` Gix, Brian
  1 sibling, 0 replies; 6+ messages in thread
From: Gix, Brian @ 2019-11-22 19:22 UTC (permalink / raw)
  To: linux-bluetooth, Stotland, Inga; +Cc: sbrown

Applied with commit msg modifications, Thanks

On Fri, 2019-11-22 at 08:23 -0800, Inga Stotland wrote:
> This removes an extra return parameter from PromptNumeric and PromptStatic
> method signatures. Also, style fixes.
> ---
>  tools/mesh-cfgclient.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/mesh-cfgclient.c b/tools/mesh-cfgclient.c
> index 1c617a37b..200eb5b84 100644
> --- a/tools/mesh-cfgclient.c
> +++ b/tools/mesh-cfgclient.c
> @@ -478,6 +478,7 @@ static struct l_dbus_message *disp_string_call(struct l_dbus *dbus,
>  						struct l_dbus_message *msg,
>  						void *user_data)
>  {
> +	const char *prompt = "Enter AlphaNumeric code on remote device:";
>  	char *str;
>  
>  	if (!l_dbus_message_get_arguments(msg, "s", &str)) {
> @@ -485,7 +486,7 @@ static struct l_dbus_message *disp_string_call(struct l_dbus *dbus,
>  		return l_dbus_message_new_error(msg, dbus_err_fail, NULL);
>  	}
>  
> -	bt_shell_printf(COLOR_YELLOW "Enter AlphaNumeric code on remote device: %s\n" COLOR_OFF, str);
> +	bt_shell_printf(COLOR_YELLOW "%s %s\n" COLOR_OFF, prompt, str);
>  
>  	return l_dbus_message_new_method_return(msg);
>  }
> @@ -542,13 +543,13 @@ static void setup_agent_iface(struct l_dbus_interface *iface)
>  								NULL);
>  	/* TODO: Other properties */
>  	l_dbus_interface_method(iface, "DisplayString", 0, disp_string_call,
> -						"", "s", "value");
> +							"", "s", "value");
>  	l_dbus_interface_method(iface, "DisplayNumeric", 0, disp_numeric_call,
>  						"", "su", "type", "number");
>  	l_dbus_interface_method(iface, "PromptNumeric", 0, prompt_numeric_call,
> -						"u", "s", "type");
> +						"u", "s", "number", "type");
>  	l_dbus_interface_method(iface, "PromptStatic", 0, prompt_static_call,
> -						"ay", "s", "type");
> +						"ay", "s", "data", "type");
>  }
>  
>  static bool register_agent(void)

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

* Re: [PATCH BlueZ] tools/mesh-cfgclient: Fix signatures in agent methods
  2019-11-22 15:38 Inga Stotland
@ 2019-11-22 15:49 ` Steve Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Steve Brown @ 2019-11-22 15:49 UTC (permalink / raw)
  To: Inga Stotland, linux-bluetooth; +Cc: brian.gix

Hi Inga,

On Fri, 2019-11-22 at 07:38 -0800, Inga Stotland wrote:
> This removes an extra return parameter from PromptNumeric and
> PromptStatic
> method signatures. Also, style fixes.
> ---
>  tools/mesh-cfgclient.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 

Fixed my SIGSEGV issue.

Thanks,

Steve


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

* [PATCH BlueZ] tools/mesh-cfgclient: Fix signatures in agent methods
@ 2019-11-22 15:38 Inga Stotland
  2019-11-22 15:49 ` Steve Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Inga Stotland @ 2019-11-22 15:38 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: brian.gix, Inga Stotland

This removes an extra return parameter from PromptNumeric and PromptStatic
method signatures. Also, style fixes.
---
 tools/mesh-cfgclient.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/mesh-cfgclient.c b/tools/mesh-cfgclient.c
index 1c617a37b..784c07fdf 100644
--- a/tools/mesh-cfgclient.c
+++ b/tools/mesh-cfgclient.c
@@ -478,6 +478,7 @@ static struct l_dbus_message *disp_string_call(struct l_dbus *dbus,
 						struct l_dbus_message *msg,
 						void *user_data)
 {
+	const char *prompt = "Enter AlphaNumeric code on remote device:";
 	char *str;
 
 	if (!l_dbus_message_get_arguments(msg, "s", &str)) {
@@ -485,7 +486,7 @@ static struct l_dbus_message *disp_string_call(struct l_dbus *dbus,
 		return l_dbus_message_new_error(msg, dbus_err_fail, NULL);
 	}
 
-	bt_shell_printf(COLOR_YELLOW "Enter AlphaNumeric code on remote device: %s\n" COLOR_OFF, str);
+	bt_shell_printf(COLOR_YELLOW "%s %s\n" COLOR_OFF, prompt, str);
 
 	return l_dbus_message_new_method_return(msg);
 }
@@ -542,13 +543,13 @@ static void setup_agent_iface(struct l_dbus_interface *iface)
 								NULL);
 	/* TODO: Other properties */
 	l_dbus_interface_method(iface, "DisplayString", 0, disp_string_call,
-						"", "s", "value");
+							"", "s", "value");
 	l_dbus_interface_method(iface, "DisplayNumeric", 0, disp_numeric_call,
 						"", "su", "type", "number");
 	l_dbus_interface_method(iface, "PromptNumeric", 0, prompt_numeric_call,
-						"u", "s", "type");
+							"", "s", "type");
 	l_dbus_interface_method(iface, "PromptStatic", 0, prompt_static_call,
-						"ay", "s", "type");
+							"", "s", "type");
 }
 
 static bool register_agent(void)
-- 
2.21.0


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

end of thread, other threads:[~2019-11-22 19:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-22 16:23 [PATCH BlueZ] tools/mesh-cfgclient: Fix signatures in agent methods Inga Stotland
2019-11-22 18:29 ` Steve Brown
2019-11-22 18:51   ` Stotland, Inga
2019-11-22 19:22 ` Gix, Brian
  -- strict thread matches above, loose matches on Subject: below --
2019-11-22 15:38 Inga Stotland
2019-11-22 15:49 ` Steve Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).