tools/mesh-cfgclient: Fix signatures in agent methods
PATCH 1/1 tools/mesh-cfgclient: Fix signatures in agent methods
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(-)
tools/mesh-cfgclient.c +5 -4
@@ -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 )
Signature · 1 line
2.21.0
Hi Inga,
tools/mesh-cfgclient.c
Quoted 12 lines · 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(-)tools/mesh-cfgclient.c +0
-0
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
Hi Steve,
Quoted 18 lines · Steve Brown
Hi Inga,
tools/mesh-cfgclient.c
Quoted 12 lines · 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(-)tools/mesh-cfgclient.c +0
-0SIGSEGV still gone.
Quoted 7 lines
I tested both the
prompt_numeric_callandprompt_static_callpaths 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
Applied with commit msg modifications, Thanks
Quoted 44 lines · 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(-)tools/mesh-cfgclient.c +5
-4@@ -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 )