From 4c286966ce1aa43360e716476ba5f24f5f1ed20c Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 5 Feb 2018 10:02:43 -0200 Subject: [PATCH] client: Don't set generators for modes Commands that already have all values set on the argument string don't need to add a generator since bt_shell can now auto complete them. Change-Id: I6a1876b4754a574ae68b1dfb7f80b16885e6d83a Signed-off-by: Amit Purwar --- client/main.c | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/client/main.c b/client/main.c index 18c8256..7f292ff 100644 --- a/client/main.c +++ b/client/main.c @@ -65,12 +65,6 @@ static GDBusProxy *default_dev; static GDBusProxy *default_attr; static GList *ctrl_list; -static const char *mode_arguments[] = { - "on", - "off", - NULL -}; - static const char *agent_arguments[] = { "on", "off", @@ -2162,11 +2156,6 @@ static char *argument_generator(const char *text, int state, return NULL; } -static char *mode_generator(const char *text, int state) -{ - return argument_generator(text, state, mode_arguments); -} - static char *capability_generator(const char *text, int state) { return argument_generator(text, state, agent_arguments); @@ -2327,7 +2316,7 @@ static const struct bt_shell_menu advertise_menu = { "Set advertise manufacturer data" }, { "tx-power", "[on/off]", cmd_advertise_tx_power, "Enable/disable TX power to be advertised", - mode_generator }, + NULL }, { "name", "[on/off/name]", cmd_advertise_name, "Enable/disable local name to be advertised" }, { "appearance", "[value]", cmd_advertise_appearance, @@ -2353,7 +2342,7 @@ static const struct bt_shell_menu scan_menu = { "Set/Get transport filter" }, { "duplicate-data", "[on/off]", cmd_scan_filter_duplicate_data, "Set/Get duplicate data filter", - mode_generator }, + NULL }, { "clear", "[uuids/rssi/pathloss/transport/duplicate-data]", cmd_scan_filter_clear, "Clears discovery filter.", @@ -2383,7 +2372,7 @@ static const struct bt_shell_menu gatt_menu = { { "release-notify", NULL, cmd_release_notify, "Release Notify file descriptor" }, { "notify", "", cmd_notify, "Notify attribute value", - mode_generator }, + NULL }, { "register-application", "[UUID ...]", cmd_register_app, "Register profile to connect" }, { "unregister-application", NULL, cmd_unregister_app, @@ -2423,13 +2412,13 @@ static const struct bt_shell_menu main_menu = { { "reset-alias", NULL, cmd_reset_alias, "Reset controller alias" }, { "power", "", cmd_power, "Set controller power", - mode_generator }, + NULL }, { "pairable", "", cmd_pairable, "Set controller pairable mode", - mode_generator }, + NULL }, { "discoverable", "", cmd_discoverable, "Set controller discoverable mode", - mode_generator }, + NULL }, { "agent", "", cmd_agent, "Enable/disable agent with given capability", capability_generator}, @@ -2439,8 +2428,7 @@ static const struct bt_shell_menu main_menu = { "Enable/disable advertising with given type", ad_generator}, { "set-alias", "", cmd_set_alias, "Set device alias" }, - { "scan", "", cmd_scan, "Scan for devices", - mode_generator }, + { "scan", "", cmd_scan, "Scan for devices", NULL }, { "info", "[dev]", cmd_info, "Device information", dev_generator }, { "pair", "[dev]", cmd_pair, "Pair with device", -- 2.7.4