D-Bus notes

We are exploring using D-Bus for a project, so collecting some notes about it.

Overview

The D-bus specification is located:

https://dbus.freedesktop.org/doc/dbus-specification.html

This article is pretty good:

It appears D-Bus is fairly highly regarded:

Today, if we’d sit down and design a completely new IPC system incorporating all the experience and knowledge we gained with D-Bus, I am sure the result would be very close to what D-Bus already is.

From Lennart’s article, we can extract the following:

  • D-Bus concepts
    • buses
      • system bus
      • session bus
    • object path – ex: /org/freedesktop/login1/session/_7. Objects have one or more interfaces.
      • interfaces – contains the following members
        • methods – functions
        • signals
        • properties
  • Features
    • access control
    • rich type system
    • discoverability
    • introspection
    • monitoring
    • reliable multicasting
    • service activation
    • file descriptor passing

C library options:

  1. libdbus: original low-level implementation
  2. GDBus: newer implementation built around GObject. Uses code-generation.
  3. sd-bus: middle ground between libdbus and GDBus. Better performance.
  4. qtdbus: may be useful if you are writing Qt code.