diff --git a/src/dbus.c b/src/dbus.c index 3ec1f524..987600f1 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -123,10 +123,13 @@ struct l_dbus *dbus_get_bus(void) return g_dbus; } -bool dbus_init(void) +bool dbus_init(bool enable_debug) { g_dbus = l_dbus_new_default(L_DBUS_SYSTEM_BUS); - l_dbus_set_debug(g_dbus, do_debug, "[DBUS] ", NULL); + + if (enable_debug) + l_dbus_set_debug(g_dbus, do_debug, "[DBUS] ", NULL); + l_dbus_set_ready_handler(g_dbus, ready_callback, g_dbus, NULL); l_dbus_set_disconnect_handler(g_dbus, disconnect_callback, NULL, NULL); diff --git a/src/dbus.h b/src/dbus.h index 8622e81b..a4cc5219 100644 --- a/src/dbus.h +++ b/src/dbus.h @@ -45,5 +45,5 @@ void dbus_dict_append_bool(struct l_dbus_message_builder *builder, struct l_dbus_message *dbus_error_busy(struct l_dbus_message *msg); struct l_dbus_message *dbus_error_failed(struct l_dbus_message *msg); -bool dbus_init(void); +bool dbus_init(bool enable_debug); bool dbus_exit(void);