1

Is there any other way to set the properties of the interface in gbdus besides using org.freedesktop.DBus.Properties:

g_dbus_connection_call_sync(conn,
                                "org.example",
                                "/org/example/object",
                                "org.freedesktop.DBus.Properties",
                                "Set",
                                g_variant_new(),
                                NULL,
                                G_DBUS_CALL_FLAGS_NONE,
                                -1,
                                NULL,
                                &error);

Is there a more convenient API?

zxc503
  • 11
  • 2

1 Answers1

1

Another approach, which may be more convenient if the interface you’re using has a lot of methods or properties, is to generate a GDBusProxy wrapper for it using gdbus-codegen. Then call methods on that generated wrapper to set properties.

Here is an example of how to use gdbus-codegen.

Philip Withnall
  • 5,293
  • 14
  • 28