AllJoyn Studio扩展是否支持生成带参数的方法



我尝试使用AllJoyn创建一个简单的项目,通过运行Windows 10 IoT的Raspberry Pi 2向我的车库门公开一个接口。

相关的Introspection XML文件如下:

<node xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance" xsi:noNamespaceSchemaLocation="https://allseenalliance.org/schemas/introspect.xsd">
    <interface name="com.hastarin.GarageDoor">
    <!--<annotation name="org.alljoyn.Bus.Secure" value="true" />-->
    <description language="en">Interface for controlling a garage door.</description>
    <property name="IsOpen" type="b" access="read">
      <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="true"/>
      <description language="en">Is TRUE if the door is open.</description>
    </property>
    <property name="IsPartiallyOpen" type="b" access="read">
      <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="true"/>
      <description language="en">Is TRUE if the door is only partially open for air flow.</description>
    </property>
    <method name="Open">
      <description language="en">Opens the door if it's closed.</description>
      <argument name="partialOpen" type="b" direction="in">
        <description language="en">
          If TRUE, the door will only be partially opened to allow air flow.
          If FALSE, the door will be fully opened.
        </description>
      </argument>
    </method>
    <method name="Close">
      <description language="en">Close the door if it's open.</description>
    </method>
    <method name="PushButton">
      <description language="en">Will trigger the push button on the garage door.</description>
    </method>
  </interface>
</node>

不幸的是,生成的服务接口不包括Open方法的参数。

 public interface IGarageDoorService
  {
    IAsyncOperation<GarageDoorOpenResult> OpenAsync([In] AllJoynMessageInfo info);
    IAsyncOperation<GarageDoorCloseResult> CloseAsync([In] AllJoynMessageInfo info);
    IAsyncOperation<GarageDoorPushButtonResult> PushButtonAsync([In] AllJoynMessageInfo info);
    IAsyncOperation<GarageDoorGetIsOpenResult> GetIsOpenAsync([In] AllJoynMessageInfo info);
    IAsyncOperation<GarageDoorGetIsPartiallyOpenResult> GetIsPartiallyOpenAsync([In] AllJoynMessageInfo info);
  }

该项目的完整源代码可以在GitHub上找到:https://github.com/hastarin/HastPiControl

有人能告诉我我是否做错了什么,或者这是否是AllJoyn Studio Extension的限制吗?

有人能提出解决办法吗?

我遇到了同样的问题。然后我偶然发现了一个使用<arg>而不是<argument>作为元素名称的示例。它对我起到了作用——我还没有机会深入研究。。。

最新更新