1

如何接收多个 int32 值,即当我收到一个值时,我需要将其指定为 type=i ,

<method name="foo3" >
  <annotation name="org.dsource.dbus.d.Returns" value="bar"/>
  <arg name="bar" type="i" direction="in"/>
</method>

但它不允许我指定为,当我这样做时,我收到错误,因为期望值为 null

<method name="foo3" >
  <annotation name="org.dsource.dbus.d.Returns" value="bar"/>
  <arg name="bar" type="ii" direction="in"/>
</method>

然后我试过了

<method name="foo3" >
  <annotation name="org.dsource.dbus.d.Returns" value="bar"/>
  <arg name="bar" type="(ii)" direction="in"/>
</method>

错误信息是:

错误 org.freedesktop.DBus.Error.InvalidArgs:消息类型“(ii)”与预期类型“((ii))”不匹配

它给出了错误,因为预期值为((ii)),我需要得到的是我需要将预期值更改为(ii)..请给我答案提前谢谢

4

1 回答 1

0

您可以将其用作 ,

 <method name='YourMethod'>"
    <arg type='i' name='name1' direction='in'/>"
     <arg type='i' name='name2' direction='in'/>"
 </method>"

并且您可以使用 (ii) 元组格式来调用该方法

于 2015-02-23T02:37:50.507 回答