Skip to contentSkip to conversation

btmgmt: Fix irks command parsing

PATCH In review Luiz Augusto von Dentz 1 participant 3 messages Mar 30, 2020 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/2 btmgmt: Fix irks command parsing

From: Luiz Augusto von Dentz <[email protected]>

btshell does not allow use of nested parameter delimiters.

---
 tools/btmgmt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/btmgmt.c +1 -1
index b1820b41c..37c1c1c9e 100644
@@ -4455,7 +4455,7 @@ static const struct bt_shell_menu main_menu = {
 		cmd_keys,		"Load Link Keys"		},
 	{ "ltks",		NULL,
 		cmd_ltks,		"Load Long Term Keys"		},
-	{ "irks",		"[--local <index>] [--file <file path>]",
+	{ "irks",		"[--local index] [--file file path]",
 		cmd_irks,		"Load Identity Resolving Keys"	},
 	{ "block",		"[-t type] <remote address>",
 		cmd_block,		"Block Device"			},
Signature · 1 line
2.21.1
author maintainer
#1 lore raw

PATCH 2/2 btmgmt: Rename version command to revision

From: Luiz Augusto von Dentz <[email protected]>

version is already handled by btshell and always refer to BlueZ version rather than MGMT version, so this renames the command to revision to avoid having the clash of command names.

---
 tools/btmgmt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/btmgmt.c +3 -3
index 37c1c1c9e..09d6e4272 100644
@@ -1025,7 +1025,7 @@ done:
 	bt_shell_noninteractive_quit(EXIT_SUCCESS);
 }
 
-static void cmd_version(int argc, char **argv)
+static void cmd_revision(int argc, char **argv)
 {
 	if (mgmt_send(mgmt, MGMT_OP_READ_VERSION, MGMT_INDEX_NONE,
 				0, NULL, version_rsp, NULL, NULL) == 0) {
@@ -4391,8 +4391,8 @@ static const struct bt_shell_menu main_menu = {
 	.entries = {
 	{ "select",		"<index>",
 		cmd_select,		"Select a different index"	},
-	{ "version",		NULL,
-		cmd_version,		"Get the MGMT Version"		},
+	{ "revision",		NULL,
+		cmd_revision,		"Get the MGMT Revision"		},
 	{ "commands",		NULL,
 		cmd_commands,		"List supported commands"	},
 	{ "config",		NULL,
Signature · 1 line
2.21.1
author maintainer
#2 lore raw
In reply to Luiz Augusto von Dentz

Hi,

Quoted 22 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

btshell does not allow use of nested parameter delimiters.

---
 tools/btmgmt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/btmgmt.c +1 -2
index b1820b41c..37c1c1c9e 100644
@@ -4455,7 +4455,7 @@ static const struct bt_shell_menu main_menu = {
                cmd_keys,               "Load Link Keys"                },
        { "ltks",               NULL,
                cmd_ltks,               "Load Long Term Keys"           },
-       { "irks",               "[--local <index>] [--file <file path>]",
+       { "irks",               "[--local index] [--file file path]",
                cmd_irks,               "Load Identity Resolving Keys"  },
        { "block",              "[-t type] <remote address>",
                cmd_block,              "Block Device"                  },
--
Quoted 2 lines

2.21.1

Pushed.

Signature · 1 line
Luiz Augusto von Dentz