Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ] advertising: add property with advertisement ID
@ 2026-05-25  4:11 Michal Dzik
  2026-05-25  7:01 ` [BlueZ] " bluez.test.bot
  2026-05-27 21:16 ` [PATCH BlueZ] " Luiz Augusto von Dentz
  0 siblings, 2 replies; 3+ messages in thread
From: Michal Dzik @ 2026-05-25  4:11 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Michal Dzik

Identifier is an internal value, but it must be exposed to client app
if client app wants to use a advertisement in BAP broadcast
---
 doc/org.bluez.LEAdvertisement.rst |  6 ++++++
 src/advertising.c                 | 13 ++++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/doc/org.bluez.LEAdvertisement.rst b/doc/org.bluez.LEAdvertisement.rst
index aae80f08f..4dd36a0cc 100644
--- a/doc/org.bluez.LEAdvertisement.rst
+++ b/doc/org.bluez.LEAdvertisement.rst
@@ -235,3 +235,9 @@ The provided value is used only if the "CanSetTxPower" feature is enabled on the
 **org.bluez.LEAdvertisingManager(5)**.
 
 Values must be in range [-127 to +20], where units are in dBm.
+
+byte Identifier [read-write, optional]
+``````````````````````````````````````
+
+Identifier of the advertisement. Set by bluetoothd after advertisement is registered with
+**org.bluez.LEAdvertisingManager(5)**.
diff --git a/src/advertising.c b/src/advertising.c
index f529ecd14..3b758f51e 100644
--- a/src/advertising.c
+++ b/src/advertising.c
@@ -1511,8 +1511,19 @@ static void add_client_complete(struct btd_adv_client *client, uint8_t status)
 		queue_remove(client->manager->clients, client);
 		g_idle_add(client_free_idle_cb, client);
 
-	} else
+	} else {
+		DBusMessageIter iter;
+
+		/* Check if the attribute has the Identifier property */
+		if (g_dbus_proxy_get_property(client->proxy, "Identifier",
+								&iter)) {
+			g_dbus_proxy_set_property_basic(client->proxy,
+				"Identifier", DBUS_TYPE_BYTE, &client->instance,
+				NULL, NULL, NULL);
+		}
+
 		reply = dbus_message_new_method_return(client->reg);
+	}
 
 	g_dbus_send_message(btd_get_dbus_connection(), reply);
 	dbus_message_unref(client->reg);
-- 
2.43.0


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

end of thread, other threads:[~2026-05-27 21:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-25  4:11 [PATCH BlueZ] advertising: add property with advertisement ID Michal Dzik
2026-05-25  7:01 ` [BlueZ] " bluez.test.bot
2026-05-27 21:16 ` [PATCH BlueZ] " 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