some simple questions on "argument direction"

Matt Guo matt at mattguo.com
Wed May 20 21:48:33 PDT 2009


thanks, Havoc, now I understand where the "ret" came from, I used NDesk.DBus.

But about "dbus args don't have names...", I still have doubt on this.
Since as I saw, in all the introspection xmls I can get with d-feet
and dbus-explorer, every arg has name, such as:

            <method name="Foo">
              <arg name="bar" type="(iiu)" direction="in"/>
                   ~~~~~~~~~
            </method>

So do you mean the following could also be a valid introspection result?
            <method name="Foo">
              <arg type="(iiu)" direction="in"/>
            </method>



And can I ask one more question:
Can I assert all the arguments of a dbus signal are "out"?

Thank you.
Matt


On Thu, May 21, 2009 at 4:02 AM, Havoc Pennington
<havoc.pennington at gmail.com> wrote:
> Hi,
>
> On Wed, May 20, 2009 at 3:50 PM, Matt Guo <matt at mattguo.com> wrote:
>> 1) a dbus argument is "out" if and ony if its name is "ret" or it's a
>> signal argument
>
> dbus args don't have names... maybe your binding does
>
>> 2) all the arguments of a dbus method (except for the "ret" argument) are "in"
>
> Nope
>
>> 3) a DBus argument can not be both "in" and "out" (i.e. "inout")
>
> True.
>
> The way dbus works is that there is a message sent to an app with the
> "in" args. The app then replies with the "out" args in a reply
> message.
>
> There can be 0-N of each type of arg.
>
> "inout" doesn't make sense, because an arg is either in the method
> call message or the reply message. If it were in both, it's two
> different args.
>
> Havoc
>



-- 
B.R.
GUO Rui (Matt)


More information about the dbus mailing list