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?
Another approach, which may be more convenient if the interface you’re using has a lot of methods or properties, is to generate a
GDBusProxywrapper for it usinggdbus-codegen. Then call methods on that generated wrapper to set properties.Here is an example of how to use
gdbus-codegen.