Getting started with Dbus

Hackfest time at Igalia :), Sergio and me spent some time trying to get started with Dbus programming. We begun with a brief look at the Dbus Tutorial, which was an excellent place to start. However, we got stuck with some minor issues, like the need to manually start the session bus daemon using the dbus-launch program and the need to set a couple of environment variables in order to let our program connect to the bus.

Once we solved the above problems, we spent some more time before it worked properly, because we lacked one step when exporting an object using Dbus, which is to register the service name. This is done by using the org_freedesktop_DBus_request_name function.

Solved the above, all worked fine!. Next step will be to analyze how to substitute bacon-mesage-connection in Gedit with Dbus, but this will be another story ;).

3 thoughts on “Getting started with Dbus”

  1. i am new with dbus. i m trying to use org_freedesktop_DBus_request_name() function, but my machine says:
    undefined reference to `org_freedesktop_DBus_request_name’.

    i also included the following header files:
    #include
    #include
    #include
    #include

    can you please tell me which library has the definition of this function??

Comments are closed.