public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/3] shared/shell: Add submenu description
@ 2017-12-12 12:14 Luiz Augusto von Dentz
  2017-12-12 12:14 ` [PATCH BlueZ 2/3] client: Add description for submenus Luiz Augusto von Dentz
  2017-12-12 12:14 ` [PATCH BlueZ 3/3] " Luiz Augusto von Dentz
  0 siblings, 2 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2017-12-12 12:14 UTC (permalink / raw)
  To: linux-bluetooth

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

This adds a field for submenu description.
---
 src/shared/shell.c | 3 ++-
 src/shared/shell.h | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/shared/shell.c b/src/shared/shell.c
index 3aa49597c..b4fdf7043 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -208,7 +208,8 @@ static void shell_print_menu(void)
 						submenu = submenu->next) {
 			struct bt_shell_menu *menu = submenu->data;
 
-			print_submenu(menu->name, "Submenu");
+			print_submenu(menu->name, menu->desc ? menu->desc :
+								"Submenu");
 		}
 	}
 
diff --git a/src/shared/shell.h b/src/shared/shell.h
index 5f86ed61e..8b8b1f634 100644
--- a/src/shared/shell.h
+++ b/src/shared/shell.h
@@ -52,6 +52,7 @@ struct bt_shell_menu_entry {
 
 struct bt_shell_menu {
 	const char *name;
+	const char *desc;
 	const struct bt_shell_menu_entry entries[];
 };
 
-- 
2.13.6


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

* [PATCH BlueZ 2/3] client: Add description for submenus
  2017-12-12 12:14 [PATCH BlueZ 1/3] shared/shell: Add submenu description Luiz Augusto von Dentz
@ 2017-12-12 12:14 ` Luiz Augusto von Dentz
  2017-12-12 12:14 ` [PATCH BlueZ 3/3] " Luiz Augusto von Dentz
  1 sibling, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2017-12-12 12:14 UTC (permalink / raw)
  To: linux-bluetooth

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

This adds proper descriptions for each submenu.
---
 client/main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/client/main.c b/client/main.c
index f3369e89a..5af4c97d8 100644
--- a/client/main.c
+++ b/client/main.c
@@ -2202,6 +2202,7 @@ static void cmd_set_advertise_timeout(int argc, char *argv[])
 
 static const struct bt_shell_menu advertise_menu = {
 	.name = "advertise",
+	.desc = "Advertising Management Submenu",
 	.entries = {
 	{ "set-uuids", "[uuid1 uuid2 ...]",
 			cmd_set_advertise_uuids, "Set advertise uuids" },
@@ -2226,6 +2227,7 @@ static const struct bt_shell_menu advertise_menu = {
 
 static const struct bt_shell_menu scan_menu = {
 	.name = "scan",
+	.desc = "Scan Filters Submenu",
 	.entries = {
 	{ "set-filter-uuids", "[uuid1 uuid2 ...]", cmd_set_scan_filter_uuids,
 				"Set scan filter uuids" },
@@ -2246,6 +2248,7 @@ static const struct bt_shell_menu scan_menu = {
 
 static const struct bt_shell_menu gatt_menu = {
 	.name = "gatt",
+	.desc = "Generic Attribute Submenu",
 	.entries = {
 	{ "list-attributes", "[dev]", cmd_list_attributes, "List attributes",
 							dev_generator },
-- 
2.13.6


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

* [PATCH BlueZ 3/3] client: Add description for submenus
  2017-12-12 12:14 [PATCH BlueZ 1/3] shared/shell: Add submenu description Luiz Augusto von Dentz
  2017-12-12 12:14 ` [PATCH BlueZ 2/3] client: Add description for submenus Luiz Augusto von Dentz
@ 2017-12-12 12:14 ` Luiz Augusto von Dentz
  2017-12-12 12:40   ` Johan Hedberg
  1 sibling, 1 reply; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2017-12-12 12:14 UTC (permalink / raw)
  To: linux-bluetooth

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

This adds proper descriptions for each submenu.
---
 mesh/config-client.c | 1 +
 mesh/onoff-model.c   | 1 +
 2 files changed, 2 insertions(+)

diff --git a/mesh/config-client.c b/mesh/config-client.c
index 3d618b6a6..aad6525c2 100644
--- a/mesh/config-client.c
+++ b/mesh/config-client.c
@@ -613,6 +613,7 @@ static void cmd_get_ttl(int argc, char *argv[])
 
 static const struct bt_shell_menu cfg_menu = {
 	.name = "config",
+	.desc = "Configuration Model Submenu",
 	.entries = {
 	{"target",		"<unicast>",			cmd_set_node,
 						"Set target node to configure"},
diff --git a/mesh/onoff-model.c b/mesh/onoff-model.c
index fc0d64617..dbbe69706 100644
--- a/mesh/onoff-model.c
+++ b/mesh/onoff-model.c
@@ -259,6 +259,7 @@ static void cmd_set(int argc, char *argv[])
 
 static const struct bt_shell_menu onoff_menu = {
 	.name = "onoff",
+	.desc = "On/Off Model Submenu",
 	.entries = {
 	{"target",		"<unicast>",			cmd_set_node,
 						"Set node to configure"},
-- 
2.13.6


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

* Re: [PATCH BlueZ 3/3] client: Add description for submenus
  2017-12-12 12:14 ` [PATCH BlueZ 3/3] " Luiz Augusto von Dentz
@ 2017-12-12 12:40   ` Johan Hedberg
  0 siblings, 0 replies; 4+ messages in thread
From: Johan Hedberg @ 2017-12-12 12:40 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi Luiz,

On Tue, Dec 12, 2017, Luiz Augusto von Dentz wrote:
> This adds proper descriptions for each submenu.
> ---
>  mesh/config-client.c | 1 +
>  mesh/onoff-model.c   | 1 +
>  2 files changed, 2 insertions(+)

I think you meant this one to have "mesh:" as prefix instead of
"client:".

Johan

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

end of thread, other threads:[~2017-12-12 12:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-12 12:14 [PATCH BlueZ 1/3] shared/shell: Add submenu description Luiz Augusto von Dentz
2017-12-12 12:14 ` [PATCH BlueZ 2/3] client: Add description for submenus Luiz Augusto von Dentz
2017-12-12 12:14 ` [PATCH BlueZ 3/3] " Luiz Augusto von Dentz
2017-12-12 12:40   ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox