client: Fix advertise broadcast
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 14 May 2021 22:10:26 +0000 (15:10 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:35 +0000 (19:08 +0530)
When advertising with type broadcast it cannot be discoverable as that
would require setting flags which is not allowed by the spec.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
client/advertising.c

index 921e8da..b693ba5 100644 (file)
@@ -511,6 +511,9 @@ void ad_register(DBusConnection *conn, GDBusProxy *manager, const char *type)
        g_free(ad.type);
        ad.type = g_strdup(type);
 
+       if (!strcasecmp(ad.type, "Broadcast"))
+               ad.discoverable = false;
+
        if (g_dbus_register_interface(conn, AD_PATH, AD_IFACE, ad_methods,
                                        NULL, ad_props, NULL, NULL) == FALSE) {
                bt_shell_printf("Failed to register advertising object\n");