DBus flags of exposed methods/properties/signals

Simon McVittie smcv at collabora.com
Fri May 17 14:59:34 UTC 2019


On Fri, 17 May 2019 at 16:49:14 +0200, Germano Massullo wrote:
> Hello. I am practicing with DBus, by using GDBus API. To achieve that
> I studied NetworkManager GDBus examples [1].
> I have a question. By reading methods/properties/signals exposed by
> systemd-logind on DBus [2], I have read things like
> readonly t IdleSinceHint = 0;
> 
> What does 't' stand for? There are also many other "flags", like 'b', 'as', etc.

It's an abbreviated way to describe the D-Bus type system. 't' is a
64-bit unsigned integer, 'b' is a Boolean value, and 'as' is an array
(a) of strings (s).

These type signatures are defined in the D-Bus Specification:
<https://dbus.freedesktop.org/doc/dbus-specification.html#type-system>

Since you're using GLib, you might find the GVariant documentation in the
GLib Reference Manual useful. The GVariant type system is a superset of the
D-Bus type system: every D-Bus type is a valid GVariant type, but not every
GVariant type is a valid D-Bus type.
<https://developer.gnome.org/glib/stable/glib-GVariantType.html#glib-GVariantType.description>

(Specifically, the GVariant types that are not valid on D-Bus are: anything
that mentions 'm', '()', 'r', '?', '*', or any occurrence of '{' except
immediately after 'a'.)

    smcv


More information about the dbus mailing list