[PATCH BlueZ 7/9] client: Rename set-filter-duplicate-data to duplicate-data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

All commands under scan submenu are related to set-filter so remove its
portion from it and make the command return the current value if no
parameters:

[bluetooth]# duplicate-data on
SetDiscoveryFilter success
[bluetooth]# duplicate-data
DuplicateData: on
---
 client/main.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/client/main.c b/client/main.c
index d8d911a37..849033870 100644
--- a/client/main.c
+++ b/client/main.c
@@ -1371,11 +1371,15 @@ static void cmd_scan_filter_transport(int argc, char *argv[])
 	cmd_set_scan_filter_commit();
 }
 
-static void cmd_set_scan_filter_duplicate_data(int argc, char *argv[])
+static void cmd_scan_filter_duplicate_data(int argc, char *argv[])
 {
-	if (argc < 2 || !strlen(argv[1]))
-		filtered_scan_duplicate_data = false;
-	else if (!strcmp(argv[1], "on"))
+	if (argc < 2 || !strlen(argv[1])) {
+		bt_shell_printf("DuplicateData: %s\n",
+				filtered_scan_duplicate_data ? "on" : "off");
+		return;
+	}
+
+	if (!strcmp(argv[1], "on"))
 		filtered_scan_duplicate_data = true;
 	else if (!strcmp(argv[1], "off"))
 		filtered_scan_duplicate_data = false;
@@ -2260,9 +2264,8 @@ static const struct bt_shell_menu scan_menu = {
 				"Set/Get Pathloss filter, and clears RSSI" },
 	{ "transport", "[transport]", cmd_scan_filter_transport,
 				"Set/Get transport filter" },
-	{ "set-filter-duplicate-data", "[on/off]",
-				cmd_set_scan_filter_duplicate_data,
-				"Set scan filter duplicate data",
+	{ "duplicate-data", "[on/off]", cmd_scan_filter_duplicate_data,
+				"Set/Get duplicate data filter",
 				mode_generator },
 	{ "set-filter-clear", NULL, cmd_set_scan_filter_clear,
 				"Clears discovery filter." },
-- 
2.13.6

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux