public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] Added BREDR not supported bit in AD Flag when discoverable is off
@ 2024-06-28  7:23 quic_prathm
  2024-06-28  9:01 ` [v1] " bluez.test.bot
  2024-06-28 13:38 ` [PATCH v1] " Luiz Augusto von Dentz
  0 siblings, 2 replies; 5+ messages in thread
From: quic_prathm @ 2024-06-28  7:23 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: luiz.dentz, quic_mohamull, quic_hbandi, quic_anubhavg

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="y", Size: 1612 bytes --]

From: Prathibha Madugonde <quic_prathm@quicinc.com>

Fix for GAP/DISC/NONM/BV-02-C
As per GAP.TS.p44 test spec
IUT does not contain General Discoverable mode and Limited Discoverable
mode in the AD Type Flag. IUT shall send AD Type Flag to PASS the test
case, thus added BR/EDR not supported bit in the AD Type Flag when
discoverable is off.

Signed-off-by: Prathibha Madugonde <quic_prathm@quicinc.com>
---
 src/advertising.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/advertising.c b/src/advertising.c
index 5d373e088..9857ceceb 100644
--- a/src/advertising.c
+++ b/src/advertising.c
@@ -1444,6 +1444,7 @@ static DBusMessage *parse_advertisement(struct btd_adv_client *client)
 {
 	struct adv_parser *parser;
 	int err;
+	uint8_t flags;
 
 	for (parser = parsers; parser && parser->name; parser++) {
 		DBusMessageIter iter;
@@ -1499,6 +1500,21 @@ static DBusMessage *parse_advertisement(struct btd_adv_client *client)
 		goto fail;
 	}
 
+	if (!btd_adapter_get_discoverable(client->manager->adapter)) {
+		/* GAP.TS.p44 Test Spec GAP/DISC/NONM/BV-02-C
+		 * page 158:
+		 * IUT does not contain
+		 * ‘LE General Discoverable Mode’ flag or the
+		 * ‘LE Limited Discoverable Mode’ flag in the Flags AD Type
+		 * But AD Flag Type should be there for the test case to
+		 * PASS. Thus BR/EDR Not Supported BIT shall be included
+		 * in the AD Type flag.
+		 */
+		flags = bt_ad_get_flags(client->data);
+		flags |= BT_AD_FLAG_NO_BREDR;
+		bt_ad_add_flags(client->data, &flags, 1);
+	}
+
 	err = refresh_advertisement(client, add_adv_callback);
 
 	if (!err)
-- 
2.17.1


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

end of thread, other threads:[~2024-07-01 14:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-28  7:23 [PATCH v1] Added BREDR not supported bit in AD Flag when discoverable is off quic_prathm
2024-06-28  9:01 ` [v1] " bluez.test.bot
2024-06-28 13:38 ` [PATCH v1] " Luiz Augusto von Dentz
2024-07-01 11:02   ` Prathibha Madugonde
2024-07-01 14:10     ` Luiz Augusto von Dentz

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