Dbus Inspector & Introspect

Sander Jansen s.jansen at gmail.com
Fri Sep 12 10:22:25 PDT 2008


I was trying make my program work with DBus Inspector. My program has
a unique name of "org.fifthplanet.gogglesmm" and exposes one object on
path: "/org/fifthplanet/gogglesmm" (it supports the interface of
"org.fifthplanet.gogglesmm" and
"org.freedesktop.DBus.Introspectable").

The Introspect method of /org/fifthplanet/gogglesmm will return the following:

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
  "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node name="/org/fifthplanet/gogglesmm">
  <interface name="org.fifthplanet.gogglesmm">
    <method name="play"/>
    <method name="playpause"/>
    <method name="pause"/>
    <method name="stop"/>
    <method name="next"/>
    <method name="prev"/>
    <method name="raise"/>
    <method name="exit"/>
    <method name="toggleshown"/>
    <method name="getactions">
    	<arg name="actions" direction="out" type="u"/>
    </method>	
    <signal name="quit"/>
    <signal name="trayexit"/>
  </interface>
  <interface name="org.freedesktop.DBus.Introspectable">
    <method name="Introspect">
      <arg name="xml_data" direction="out" type="s"/>
    </method>
  </interface>
</node>

Currently DBus Inspector won't list any of these methods, since it
doesn't know about the object on path "/org/fifthplanet/gogglesmm". I
see DBus Inspector calling "Introspect" on path "/". Would I have to
respond with the following then?:

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
  "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node name="/">
  <interface name="org.freedesktop.DBus.Introspectable">
    <method name="Introspect">
      <arg name="xml_data" direction="out" type="s"/>
    </method>
  </interface>
  <node name="/org/fifthplanet/gogglesmm"/>
</node>

Would this be the correct and standard way of doing this? The last
response on my question on the list about object path naming
conventions seems to discourage using the "/" path...

Thanks, Sander

-- 
"And any fool knows a dog needs a home
A shelter from pigs on the wing"


More information about the dbus mailing list