[PATCH BlueZ 4/9] client: Rename set-filter-rssi to rssi

[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]# rssi 0
SetDiscoveryFilter success
[bluetooth]# rssi
RSSI: 0
---
 client/main.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/client/main.c b/client/main.c
index 8dd92549e..06e4905e9 100644
--- a/client/main.c
+++ b/client/main.c
@@ -1327,14 +1327,16 @@ commit:
 	cmd_set_scan_filter_commit();
 }
 
-static void cmd_set_scan_filter_rssi(int argc, char *argv[])
+static void cmd_scan_filter_rssi(int argc, char *argv[])
 {
-	filtered_scan_pathloss = DISTANCE_VAL_INVALID;
+	if (argc < 2 || !strlen(argv[1])) {
+		if (filtered_scan_rssi != DISTANCE_VAL_INVALID)
+			bt_shell_printf("RSSI: %d\n", filtered_scan_rssi);
+		return;
+	}
 
-	if (argc < 2 || !strlen(argv[1]))
-		filtered_scan_rssi = DISTANCE_VAL_INVALID;
-	else
-		filtered_scan_rssi = atoi(argv[1]);
+	filtered_scan_pathloss = DISTANCE_VAL_INVALID;
+	filtered_scan_rssi = atoi(argv[1]);
 
 	cmd_set_scan_filter_commit();
 }
@@ -2246,8 +2248,8 @@ static const struct bt_shell_menu scan_menu = {
 	.entries = {
 	{ "uuids", "[all/uuid1 uuid2 ...]", cmd_scan_filter_uuids,
 				"Set/Get UUIDs filter" },
-	{ "set-filter-rssi", "[rssi]", cmd_set_scan_filter_rssi,
-				"Set scan filter rssi, and clears pathloss" },
+	{ "rssi", "[rssi]", cmd_scan_filter_rssi,
+				"Set/Get RSSI filter, and clears pathloss" },
 	{ "set-filter-pathloss", "[pathloss]", cmd_set_scan_filter_pathloss,
 				"Set scan filter pathloss, and clears rssi" },
 	{ "set-filter-transport", "[transport]", cmd_set_scan_filter_transport,
-- 
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