[gdbus-codegen] handle property set on the service-side



Hi everyone,

I am developing a DBus service with GDBus. To avoid the repetitive and fastidious task of wrapping the dbus signals, properties and method call handling, I am using gdbus-codegen to generate the wrapper from a XML introspection file.

I think I might have reached some limitation with this method while trying to handle a property set from the service side. The generated code provides a vtable for the interface with the property_get and property_set handlers set. When a property set is received, the GObject property is automatically changed without having to be handled by the developer.

My opinion is that the service should be able to refuse a property set in some cases. For example, a property GNSSEnabled can be set true to activate the GNSS output only if the modem is powered on. Then, I'll need to return an error and prevent the property set if the modem is off.

My questions are:

1) Is there a way to do that that I haven't found (with gdbus-codegen generated files) ? 2) Should I avoid refusing a property set and use a method call instead to enable the output ?
3) Is it a feature to be added to gdbus-codegen ?

Best regards,
Gabriel Lucas


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]