2020-12-02 01:22:37

by Manish Mandlik

[permalink] [raw]
Subject: [bluez PATCH v1 3/3] client: Fix add advertisement monitor

This patch fixes bluetoothctl add-monitor to emit
InterfacesAdded/InterfacesRemoved signals correctly.

Signed-off-by: Manish Mandlik <[email protected]>
Reviewed-by: [email protected]
Reviewed-by: [email protected]
Reviewed-by: [email protected]

---

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


2020-12-02 17:50:49

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [bluez PATCH v1 3/3] client: Fix add advertisement monitor

Hi Manish,

On Tue, Dec 1, 2020 at 5:20 PM Manish Mandlik <[email protected]> wrote:
>
> This patch fixes bluetoothctl add-monitor to emit
> InterfacesAdded/InterfacesRemoved signals correctly.
>
> Signed-off-by: Manish Mandlik <[email protected]>
> Reviewed-by: [email protected]
> Reviewed-by: [email protected]
> Reviewed-by: [email protected]
>
> ---
>
> 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

--
Luiz Augusto von Dentz