public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] client: Invalidate scan filter on "scan" command
@ 2023-11-08 16:19 Jonas Dreßler
  2023-11-08 17:28 ` [BlueZ] " bluez.test.bot
  2023-11-13 19:22 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Jonas Dreßler @ 2023-11-08 16:19 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jonas Dreßler

The "scan bredr" and "scan le" commands are broken right now because the
transport filter gets set, but not actually invalidated.

Invalidate the filter with `filter.set = false` so that it actually gets
updated when set_discovery_filter() is called afterwards.
---
 client/main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/client/main.c b/client/main.c
index 88b5d5d0c..51d08a67a 100644
--- a/client/main.c
+++ b/client/main.c
@@ -1325,9 +1325,14 @@ static void cmd_scan(int argc, char *argv[])
 		return bt_shell_noninteractive_quit(EXIT_FAILURE);
 
 	if (enable == TRUE) {
-		if (strcmp(mode, "")) {
+		if (!g_strcmp0(mode, "")) {
+			g_free(filter.transport);
+			filter.transport = NULL;
+			filter.set = false;
+		} else {
 			g_free(filter.transport);
 			filter.transport = g_strdup(mode);
+			filter.set = false;
 		}
 
 		set_discovery_filter(false);
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-11-13 19:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-08 16:19 [PATCH BlueZ] client: Invalidate scan filter on "scan" command Jonas Dreßler
2023-11-08 17:28 ` [BlueZ] " bluez.test.bot
2023-11-13 19:22 ` [PATCH BlueZ] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox