main: Add call to g_dbus_set_debug
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 29 Oct 2024 21:27:14 +0000 (17:27 -0400)
committerWootak Jung <wootak.jung@samsung.com>
Thu, 20 Feb 2025 07:43:24 +0000 (16:43 +0900)
This adds a call to g_dbus_set_debug which enabled debugging of D-Bus
messages when dynamic debug is enabled for main.c:

bluetoothd[3672799]: [:1.38799:method_call] > org.bluez.Device1.Connect [#761]
bluetoothd[3672799]: [:1.38799:error] < org.bluez.Error.Failed [#761]

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
src/main.c

index 812e54635e93b1ab7460c5805f503b938dd596b1..6c059c40ec30b2f1149afdec30725b3d00d4e7ba 100755 (executable)
@@ -1377,6 +1377,11 @@ static void disconnected_dbus(DBusConnection *conn, void *data)
        mainloop_quit();
 }
 
+static void dbus_debug(const char *str, void *data)
+{
+       DBG_IDX(0xffff, "%s", str);
+}
+
 static int connect_dbus(void)
 {
        DBusConnection *conn;
@@ -1398,6 +1403,7 @@ static int connect_dbus(void)
 
        g_dbus_set_disconnect_function(conn, disconnected_dbus, NULL, NULL);
        g_dbus_attach_object_manager(conn);
+       g_dbus_set_debug(dbus_debug, NULL, NULL);
 
        return 0;
 }