alljoyn - AllJoyn Studio Extension 是否支持生成带参数的方法?

标签 alljoyn windowsiot

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

相关的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>

不幸的是,生成的服务接口(interface)不包含 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 扩展的限制?

有人可以提出解决方法吗?

最佳答案

我也遇到了同样的问题。然后我偶然发现了一个使用 <arg> 的示例而不是<argument>为元素名称。它对我有用 - 没有机会进一步研究它......

关于alljoyn - AllJoyn Studio Extension 是否支持生成带参数的方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34631410/

相关文章:

android - WiFi-Direct Api 和 Alljoyn 框架的区别

c# - RFID RC522 Raspberry PI 2 Windows 物联网

raspberry-pi - 为什么 Gamepad.GetCurrentReading() 不起作用?

java - Alljoyn 框架 - Java - 信号。 BUS_NO_SUCH_INTERFACE

bluetooth - 类似于AllJoyn的系统

ios - Objective C 消息参数数组解析(AJNMessageArgument)

protocols - 适用于 Windows IOT Core 的 MQTT 代理?

android - 带有 AllJoyn 的 Unity3D : Multiplayer-Game Synchronization

c# - 从外部 LAN raspberry pi 3 windowsiot 连接到网络服务器

c# - 树莓派 2 和 BMP280 : Slave address was not acknowledged