tags:

views:

25

answers:

1

I am having an issue with DBus:

  1. I register with DBus *dbus_bus_get()* method : OK
  2. I add filter matches : OK
  3. I add a filter callback function: OK
  4. I start a dispatch loop through *dbus_connection_read_write_dispatch()* : OK

Everything works OK. Now, if I insert:

1a. *dbus_bus_get_unique_name()*

I get a nasty exception message:

arguments to *dbus_connection_send_with_reply_and_block()* were incorrect, assertion "(error) == NULL || !*dbus_error_is_set ((error))*" failed in file dbus-connection.c line 3301.

Help please.

A: 

After some experimentation, it seems that the function dbus_bus_get_unique_name() must be called from within a specific context. I managed to get a meaningful result when accessing this function through a filter callback function e.g. one registered with dbus_add_filter function.

jldupont