Search code examples
linuxdbusbluez

Choosing cross-distro DBus implementation


I'm trying to write a systemd daemon which should register new service in SDP, listen for RFCOMM connections and exchange some information with other Bluetooth devices. The daemon should be as distro-independent as possible. Since I want to use BlueZ5 I need to make use of DBus (which is new to me).

So here comes my question, will choosing GDBus make my daemon run only on systems with GNOME installed? Or similiarly, will QtDBus only work with KDE? If yes, what should I do to be able to run it on multiple distros?


Solution

  • From the freedesktop wiki

    The low-level libdbus reference library has no required dependencies; the reference bus daemon's only required dependency is an XML parser (expat). Higher-level bindings specific to particular frameworks (Qt, GLib, Java, C#, Python, etc.) add more dependencies, but can make more assumptions and are thus much simpler to use. The bindings evolve separately from the low-level libdbus, so some are more mature and ABI-stable than others; check the docs for the binding you plan to use.

    So you can be as platform independent as you want.

    Parthiban's suggestion in the comments is probably your best bet, since even the libdbus developers recommend GDBus as the better option.

    A nice overview of your options can be found here.