Playing with DBus - 2

March 23rd, 2007

Some more DBus poking…

Listing the interfaces available in session (or system)

#> dbus-send –session –type=method_call –print-reply –dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames

method return sender=org.freedesktop.DBus -> dest=:1.49
[string “org.freedesktop.DBus”
string “:1.49″
string “:1.3″
string “org.gnome.PowerManager”
string “org.gnome.ScreenSaver”
string “org.xchat.service”
string “:1.4″
string “:1.0″
string “:1.5″
string “:1.6″
string “:1.2″

Now lets query org.gnome.PowerManager

#> dbus-send –session –type=method_call –print-reply –dest=org.gnome.PowerManager /org/gnome/PowerManager org.freedesktop.DBus.Introspectable.Introspect

method return sender=:1.2 -> dest=:1.52
string “<!DOCTYPE node PUBLIC “-//freedesktop//DTD D-BUS Object Introspection 1.0//EN”
“http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd”>
<node>
<interface name=”org.freedesktop.DBus.Introspectable”>
<method name=”Introspect”>
<arg name=”data” direction=”out” type=”s”/>
</method>
</interface>
<interface name=”org.freedesktop.DBus.Properties”>
<method name=”Get”>
<arg name=”interface” direction=”in” type=”s”/>
<arg name=”propname” direction=”in” type=”s”/>
<arg name=”value” direction=”out” type=”v”/>
</method>

[SNIP]

</signal>
<signal name=”OnAcChanged”>
<arg type=”b”/>
</signal>
</interface>
</node>

Note : Remember to use –session when introspecting services listed with –session flag & vice-versa (–system)

Posted in DBus | Comments (0)

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image