Linux bluetooth development
 help / color / mirror / Atom feed
From: Kevin Dewald <kevin@simpleble.org>
To: linux-bluetooth@vger.kernel.org
Cc: Kevin Dewald <kevin@simpleble.org>
Subject: [PATCH BlueZ 3/3] emulator: Fix report type after a scan response
Date: Mon,  5 Oct 2026 09:21:17 -0700	[thread overview]
Message-ID: <20261005162117.4606-4-kevin@simpleble.org> (raw)
In-Reply-To: <20261005162117.4606-1-kevin@simpleble.org>

ext_adv_broadcast stored the scan response type in report_type, which
is also used for the advertising report to the next scanner, so every
active scanner after the first got the advertisement reported as a scan
response.

Fixes: 32339501a125 ("emulator: Add 5.0 feature support")
Assisted-by: Claude:claude-opus-5.5
---
 emulator/btdev.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/emulator/btdev.c b/emulator/btdev.c
index e11857c3b..e00f78288 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -5537,17 +5537,19 @@ static bool ext_adv_broadcast(void *user_data)
 
 		/* if scannable bit is set the send scan response */
 		if (ext_adv->type & 0x02) {
+			uint16_t rsp_type;
+
 			if (ext_adv->type == 0x13)
-				report_type = 0x1b;
+				rsp_type = 0x1b;
 			else if (ext_adv->type == 0x12)
-				report_type = 0x1a;
+				rsp_type = 0x1a;
 			else if (!(ext_adv->type & 0x10))
-				report_type |= 0x08;
+				rsp_type = report_type | 0x08;
 			else
 				continue;
 
 			send_ext_adv(btdev_list[i], btdev, ext_adv,
-							report_type, true);
+							rsp_type, true);
 		}
 	}
 
-- 
2.54.0 (Apple Git-157)


  parent reply	other threads:[~2026-10-05 16:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-05 16:21 [PATCH BlueZ 0/3] emulator: Fix extended advertising report types Kevin Dewald
2026-10-05 16:21 ` [PATCH BlueZ 1/3] emulator: Remove unused le_ext_adv_type Kevin Dewald
2026-10-05 20:12   ` emulator: Fix extended advertising report types bluez.test.bot
2026-10-05 16:21 ` [PATCH BlueZ 2/3] emulator: Fix extended scan response Event_Type Kevin Dewald
2026-10-05 16:21 ` Kevin Dewald [this message]
2026-10-07 18:40 ` [PATCH BlueZ 0/3] emulator: Fix extended advertising report types patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261005162117.4606-4-kevin@simpleble.org \
    --to=kevin@simpleble.org \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox