diff mbox series

[Bluez] Advertising: Emit features property update

Message ID 20240325181004.Bluez.1.I8b0ed6ef2fa5a273f990a5c9f0872aaa539b8b39@changeid
State New
Headers show
Series [Bluez] Advertising: Emit features property update | expand

Commit Message

Yun-hao Chung March 25, 2024, 10:10 a.m. UTC
From: Yun-Hao Chung <howardchung@google.com>

Advertising manager has some properties that relies on kernel
information. Once we received the information from kernel, we should
emit property update.

Reviewed-by: apusaka <apusaka@chromium.org>
---

 src/advertising.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/src/advertising.c b/src/advertising.c
index 0131fc1c7..7f55a20e3 100644
--- a/src/advertising.c
+++ b/src/advertising.c
@@ -1890,6 +1890,19 @@  static void read_adv_features_callback(uint8_t status, uint16_t length,
 	/* Reset existing instances */
 	if (feat->num_instances)
 		remove_advertising(manager, 0);
+
+	/* Emit property update */
+	g_dbus_emit_property_changed(btd_get_dbus_connection(),
+		adapter_get_path(manager->adapter),
+		LE_ADVERTISING_MGR_IFACE, "SupportedFeatures");
+
+	g_dbus_emit_property_changed(btd_get_dbus_connection(),
+		adapter_get_path(manager->adapter),
+		LE_ADVERTISING_MGR_IFACE, "SupportedIncludes");
+
+	g_dbus_emit_property_changed(btd_get_dbus_connection(),
+		adapter_get_path(manager->adapter),
+		LE_ADVERTISING_MGR_IFACE, "SupportedSecondaryChannels");
 }
 
 static void read_controller_cap_complete(uint8_t status, uint16_t length,