Diff between 3e55926dac6106f97ee81dc15142f9e6ef9c6c7b and 7319353d40ab22b4e7775125952f631785520dc5

Changed Files

File Additions Deletions Status
client/main.c +47 -40 modified

Full Patch

diff --git a/client/main.c b/client/main.c
index 3538a10..fca3176 100644
--- a/client/main.c
+++ b/client/main.c
@@ -2401,6 +2401,52 @@ static const struct bt_shell_menu scan_menu = {
 	{ } },
 };
 
+static const struct bt_shell_menu gatt_menu = {
+	.name = "gatt",
+	.entries = {
+	{ "list-attributes", "[dev]", cmd_list_attributes, "List attributes",
+							dev_generator },
+	{ "set-alias",    "<alias>",  cmd_set_alias, "Set device alias" },
+	{ "select-attribute", "<attribute/UUID>",  cmd_select_attribute,
+				"Select attribute", attribute_generator },
+	{ "attribute-info", "[attribute/UUID]",  cmd_attribute_info,
+				"Select attribute", attribute_generator },
+	{ "read",         NULL,       cmd_read, "Read attribute value" },
+	{ "write",        "<data=[xx xx ...]>", cmd_write,
+						"Write attribute value" },
+	{ "acquire-write", NULL, cmd_acquire_write,
+					"Acquire Write file descriptor" },
+	{ "release-write", NULL, cmd_release_write,
+					"Release Write file descriptor" },
+	{ "acquire-notify", NULL, cmd_acquire_notify,
+					"Acquire Notify file descriptor" },
+	{ "release-notify", NULL, cmd_release_notify,
+					"Release Notify file descriptor" },
+	{ "notify",       "<on/off>", cmd_notify, "Notify attribute value",
+							mode_generator },
+	{ "register-application", "[UUID ...]", cmd_register_app,
+						"Register profile to connect" },
+	{ "unregister-application", NULL, cmd_unregister_app,
+						"Unregister profile" },
+	{ "register-service", "<UUID>", cmd_register_service,
+					"Register application service."  },
+	{ "unregister-service", "<UUID/object>", cmd_unregister_service,
+					"Unregister application service" },
+	{ "register-characteristic", "<UUID> <Flags=read,write,notify...>",
+					cmd_register_characteristic,
+					"Register application characteristic" },
+	{ "unregister-characteristic", "<UUID/object>",
+				cmd_unregister_characteristic,
+				"Unregister application characteristic" },
+	{ "register-descriptor", "<UUID> <Flags=read,write...>",
+					cmd_register_descriptor,
+					"Register application descriptor" },
+	{ "unregister-descriptor", "<UUID/object>",
+					cmd_unregister_descriptor,
+					"Unregister application descriptor" },
+	{ } },
+};
+
 static const struct bt_shell_menu main_menu = {
 	.name = "main",
 	.entries = {
@@ -2452,46 +2498,6 @@ static const struct bt_shell_menu main_menu = {
 							dev_generator },
 	{ "disconnect",   "[dev]",    cmd_disconn, "Disconnect device",
 							dev_generator },
-	{ "list-attributes", "[dev]", cmd_list_attributes, "List attributes",
-							dev_generator },
-	{ "set-alias",    "<alias>",  cmd_set_alias, "Set device alias" },
-	{ "select-attribute", "<attribute/UUID>",  cmd_select_attribute,
-				"Select attribute", attribute_generator },
-	{ "attribute-info", "[attribute/UUID]",  cmd_attribute_info,
-				"Select attribute", attribute_generator },
-	{ "read",         NULL,       cmd_read, "Read attribute value" },
-	{ "write",        "<data=[xx xx ...]>", cmd_write,
-						"Write attribute value" },
-	{ "acquire-write", NULL, cmd_acquire_write,
-					"Acquire Write file descriptor" },
-	{ "release-write", NULL, cmd_release_write,
-					"Release Write file descriptor" },
-	{ "acquire-notify", NULL, cmd_acquire_notify,
-					"Acquire Notify file descriptor" },
-	{ "release-notify", NULL, cmd_release_notify,
-					"Release Notify file descriptor" },
-	{ "notify",       "<on/off>", cmd_notify, "Notify attribute value",
-							mode_generator },
-	{ "register-application", "[UUID ...]", cmd_register_app,
-						"Register profile to connect" },
-	{ "unregister-application", NULL, cmd_unregister_app,
-						"Unregister profile" },
-	{ "register-service", "<UUID>", cmd_register_service,
-					"Register application service."  },
-	{ "unregister-service", "<UUID/object>", cmd_unregister_service,
-					"Unregister application service" },
-	{ "register-characteristic", "<UUID> <Flags=read,write,notify...>",
-					cmd_register_characteristic,
-					"Register application characteristic" },
-	{ "unregister-characteristic", "<UUID/object>",
-				cmd_unregister_characteristic,
-				"Unregister application characteristic" },
-	{ "register-descriptor", "<UUID> <Flags=read,write...>",
-					cmd_register_descriptor,
-					"Register application descriptor" },
-	{ "unregister-descriptor", "<UUID/object>",
-					cmd_unregister_descriptor,
-					"Unregister application descriptor" },
 	{ } },
 };
 
@@ -2544,6 +2550,7 @@ int main(int argc, char *argv[])
 	bt_shell_set_menu(&main_menu);
 	bt_shell_add_submenu(&advertise_menu);
 	bt_shell_add_submenu(&scan_menu);
+	bt_shell_add_submenu(&gatt_menu);
 	bt_shell_set_prompt(PROMPT_OFF);
 
 	dbus_conn = g_dbus_setup_bus(DBUS_BUS_SYSTEM, NULL, NULL);