GDBus: Omit PropertiesChanged signal and add match rule

Jean-Pierre.Bogler at continental-corporation.com Jean-Pierre.Bogler at continental-corporation.com
Fri Mar 9 00:46:43 PST 2012


Dear all,

I'm currently working on a project where I need to provide information 
over D-Bus. Because it is not recommended to use the dbus-glib
for new projects, I started developing with GDBus. I hope that you can 
help me with some questions regarding my D-Bus connection.

At first I want to give you a very short overview about the project. I 
have to offer five types of information on the D-Bus:
SystemState, SessionStates, WakeupReason, ShutdownReason and ResetReason.
I expect that the SystemState and SessionStates change often, while the 
remaining information is rarely touched.
All informations fit into basic data types, accept for the SessionStates, 
which are an array of booleans, where every session can be marked as 
active/inactive. Because there seem to be many clients interested, I want 
to emit a signal if the SessionState or SystemStates changes.

Now my questions are:

1. When I use a 'D-Bus property', I noticed that a signal is send 
everytime I change its value. The D.-Bus specification says that
I can omit this sending using the annotation 
'org.freedesktop.DBus.Property.EmitsChangedSignal'. Unfortunately GLib 
doesn't seem
to support this annotation or did I miss something?

2. The clients waiting for the signals are not interested in every System- 
or SessionState. Therefore I want send the signal with the first
the Session- or StateName (string) as first argument and apply a match 
rule. Is this a good programming praxis?

3. This is not a D-Bus topic, but maybe you can help me: Do you know a 
good place to learn the insights of the GMainloop? For example I still 
wonder how g_mainloop_new, g_signal_connect and g_mainloop_run are 
working. From the passed parameters I can see no connection between the 
D-Bus object and the loop. Furthermore I noticed that the signals seem to 
be queued (I fired multiple of them on the main loop, while another one 
was processd.). Is this queue limited?

It would be nice if you can help me with these questions.

Best regards,
Jean-Pierre Bogler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20120309/fe7864b5/attachment.htm>


More information about the dbus mailing list