diff mbox series

[bluez,v1,3/3] client: Fix add advertisement monitor

Message ID 20201201171838.bluez.v1.3.Ic1f25ec863fe218390cfbe5e5252f787a4475d3b@changeid (mailing list archive)
State New, archived
Headers show
Series Emit InterfacesAdded/InterfacesRemoved at correct root path | expand

Commit Message

Manish Mandlik Dec. 2, 2020, 1:19 a.m. UTC
This patch fixes bluetoothctl add-monitor to emit
InterfacesAdded/InterfacesRemoved signals correctly.

Signed-off-by: Manish Mandlik <mmandlik@google.com>
Reviewed-by: sonnysasaka@chromium.org
Reviewed-by: howardchung@google.com
Reviewed-by: mcchou@chromium.org

---

 client/adv_monitor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Luiz Augusto von Dentz Dec. 2, 2020, 5:48 p.m. UTC | #1
Hi Manish,

On Tue, Dec 1, 2020 at 5:20 PM Manish Mandlik <mmandlik@google.com> wrote:
>
> This patch fixes bluetoothctl add-monitor to emit
> InterfacesAdded/InterfacesRemoved signals correctly.
>
> Signed-off-by: Manish Mandlik <mmandlik@google.com>
> Reviewed-by: sonnysasaka@chromium.org
> Reviewed-by: howardchung@google.com
> Reviewed-by: mcchou@chromium.org
>
> ---
>
>  client/adv_monitor.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/client/adv_monitor.c b/client/adv_monitor.c
> index 8e81857af..1d1745831 100644
> --- a/client/adv_monitor.c
> +++ b/client/adv_monitor.c
> @@ -602,8 +602,9 @@ void adv_monitor_add_monitor(DBusConnection *conn, char *type,
>         adv_monitor->patterns = patterns;
>         adv_monitor->path = g_strdup_printf("%s/%hhu", ADV_MONITOR_APP_PATH,
>                                                                 adv_mon_idx);
> -       if (g_dbus_register_interface(conn, adv_monitor->path,
> +       if (g_dbus_register_interface_full(conn, adv_monitor->path,
>                                         ADV_MONITOR_INTERFACE,
> +                                       ADV_MONITOR_APP_PATH,
>                                         adv_monitor_methods, NULL,
>                                         adv_monitor_props, adv_monitor,
>                                         free_adv_monitor) == FALSE) {
> --
> 2.29.2.454.gaff20da3a2-goog

Nack, the right fix here is to use the real root path which is '"/"
just like is done in client/gatt.c
diff mbox series

Patch

diff --git a/client/adv_monitor.c b/client/adv_monitor.c
index 8e81857af..1d1745831 100644
--- a/client/adv_monitor.c
+++ b/client/adv_monitor.c
@@ -602,8 +602,9 @@  void adv_monitor_add_monitor(DBusConnection *conn, char *type,
 	adv_monitor->patterns = patterns;
 	adv_monitor->path = g_strdup_printf("%s/%hhu", ADV_MONITOR_APP_PATH,
 								adv_mon_idx);
-	if (g_dbus_register_interface(conn, adv_monitor->path,
+	if (g_dbus_register_interface_full(conn, adv_monitor->path,
 					ADV_MONITOR_INTERFACE,
+					ADV_MONITOR_APP_PATH,
 					adv_monitor_methods, NULL,
 					adv_monitor_props, adv_monitor,
 					free_adv_monitor) == FALSE) {